Skip to content

feat: add agent-friendly CLI interface - #340

Closed
thinkter wants to merge 6 commits into
ACM-VIT:devfrom
thinkter:agent/cli-agent-interface
Closed

thinkter wants to merge 6 commits into
ACM-VIT:devfrom
thinkter:agent/cli-agent-interface

Conversation

@thinkter

@thinkter thinkter commented Oct 27, 2026 •

Copy link
Copy Markdown
Member

What this adds

This adds an agent-friendly interface to cli-top for reliable non-interactive use:

  • typed contract errors with stable exit codes
  • public --output json and --non-interactive flags
  • typed domain results and stable selectors/IDs
  • discovery commands for semesters, class groups, courses, and faculties
  • offline schema discovery with required flags, defaults, conflicts, and conditional requirements
  • structured recovery details (required_flags, choices, and next)
  • atomic encrypted credential configuration writes
  • agent interface documentation and contract tests

Live authenticated examples

These commands were run against the contributor's authenticated VTOP session. Credentials and personally identifying academic values are omitted; the JSON envelope and command behavior are shown as observed.

$ cli-top profile --output json --non-interactive
exit 0
{"ok":true,"data":{"profile":{...redacted personal fields...}}}

$ cli-top semesters --output json --non-interactive
exit 0
{"ok":true,"data":{"semesters":[...typed semester objects...]}}

$ cli-top cgpa --output json --non-interactive
exit 0
{"ok":true,"data":{"cgpa":...}}

$ cli-top marks --semester-id VL20262701 --output json --non-interactive
exit 0
{"ok":true,"data":{"semester_id":"VL20262701","marks":[...typed mark objects...]}}

$ cli-top attendance --output json --non-interactive
exit 5
{"ok":false,"error":{"code":"parse_error",...}}

The live attendance call also demonstrated the structured failure path: VTOP returned a numeric value that the current attendance parser rejects, so the command returned a typed parse_error and non-zero exit status instead of silently producing incorrect data.

Validation

  • go test ./...
  • go test -race ./...
  • go vet ./...
  • git diff --check

Implementation and live-session validation were performed with thinkter's 6.1 sol.

spent a lot of water and tokens to review your slop

RetriggerView in GreptileConfidence Score: 4/5 Tier: apex

The bulk-download fix is sound, but the earlier post-submission retry issue still blocks merging.

Fix All in CodexFindings

  1. P1 Submitted requests invite retries ▶
  2. P2 Material module numbers disappear ▶
  3. P2 Material links stop working ▶

Summary

Adds an agent-friendly CLI with typed results, JSON output, stable selectors, offline schemas, and structured errors.

  • CLI commands return structured results and clear recovery choices.
  • VTOP features return typed data and stable IDs for academic choices.
  • The proxy returns shared feature results in its existing response wrapper.
  • Saved VTOP credentials are written atomically.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  CLI["Public commands"] --> Execute["features.Session.Execute"]
  Proxy["Proxy adapter"] --> Execute
  Execute --> VTOP["VTOP"]
  VTOP --> Results["Typed results and errors"]
  Results --> JSON["JSON and exit codes"]
  Results --> Tables["Terminal tables"]
  Schema["Offline schema"] --> Definitions["Flags and result types"]
Loading

Reviews (3) · Last reviewed commit: "fix: rate limit material batches" · Reviewed by Greptile

Comment thread cmd/creds.go Resolved
Comment thread features/api_schedule.go Resolved
Comment thread features/api.go Resolved
Comment thread features/api_courses.go Resolved
Comment thread features/api_simple.go Resolved
Comment thread features/api_courses.go Resolved
Comment thread types/results.go Resolved
Comment thread features/api_courses.go Resolved
Comment thread features/api_courses.go Resolved
Comment thread features/api_courses.go Resolved
@theg1239 theg1239 closed this Nov 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants