Documentation
¶
Overview ¶
Package cli is agentop: the commands that inspect and run Cortex — a terminal UI over AuthBridge's in-memory session store, plus subcommands for running Cortex as a service, pointing Claude Code at it, and costing tool definitions.
A package rather than a `main`, so that one binary carries both halves of Cortex: `cortex <command>` calls Main directly, and the standalone `agentop` binary (../main.go) is a shim that execs `cortex`. Two binaries meant two version numbers that could disagree about each other and two things to keep current; one binary makes "is anything out of date?" a single question. See cmd/README.md.
`cortex observe` opens the viewer — a Namespaces → Pods picker, then the session-events view for the pod it port-forwards. Pass --endpoint to skip the picker and connect directly.
A bare `cortex` opens the viewer as well, and that is the documented path now rather than a tolerated leftover. Two cases take precedence over it: with no terminal on either end it writes the root usage to stderr and exits 2, so a container or a CI step gets something it can act on instead of a TUI error; and on a moca host, where MOCA_EGRESS_CONTROL_SOCK is set, it starts the egress proxy, because a viewer there would leave the host with no egress.
Index ¶
Constants ¶
const MocaControlSockEnv = "MOCA_EGRESS_CONTROL_SOCK"
Variables ¶
This section is empty.
Functions ¶
func Main ¶
Main runs an agentop command line and returns the process exit code.
prefix is the command words that reached here: {os.Args[0]} from both hosts, since cmd/cortex passes os.Args[:1]. Nothing sends {os.Args[0], "agentop"} any more. Kept as a parameter rather than read from os.Args here, because setup quotes it back at the user and a test must be able to supply it.
Returns the code rather than calling os.Exit, so that a host `main` owns the exit and the TestMain child in cmd_observe_test.go can drive this the same way.
func SetServe ¶
SetServe registers the function that starts the proxy, which is what `cortex serve` and the legacy flags-only command line reach.
Injected rather than imported, because the dependency only runs one way: cmd/cortex imports these commands, so these commands cannot import the proxy. One list of names then drives the dispatch, the usage text and the unknown-command message (approach A in #2313).
func SetVersion ¶
func SetVersion(v, versionLine, rev string)
SetVersion records the host binary's version, the line its `--version` prints, and its build revision, so that `cortex --version`, the service stamp and the viewer's title bar all name the binary actually running.
Called once, before Main, by whatever `main` links these commands in. A caller that does not call it leaves "dev", which is what a local build of the shim's own tests sees.
Types ¶
This section is empty.
Source Files
¶
- bob_settings_json.go
- cmd_bob.go
- cmd_bob_launch.go
- cmd_bobshell.go
- cmd_claudecode.go
- cmd_codex.go
- cmd_config_migrate.go
- cmd_config_migrate_contextguru.go
- cmd_config_migrate_metrics.go
- cmd_config_migrate_pricing.go
- cmd_configure.go
- cmd_configure_args.go
- cmd_cost.go
- cmd_doctor.go
- cmd_doctor_checks.go
- cmd_exec.go
- cmd_experimental.go
- cmd_export.go
- cmd_import.go
- cmd_norecord.go
- cmd_opencode.go
- cmd_pi.go
- cmd_pipeline.go
- cmd_pricing.go
- cmd_script.go
- cmd_server.go
- cmd_server_write.go
- cmd_service.go
- cmd_service_platform.go
- cmd_setup.go
- cmd_tools.go
- cmd_uninstall.go
- cmd_update.go
- cmd_update_auto.go
- codex_daemon.go
- configure_status.go
- doctor_unread.go
- linkloop_other.go
- local_endpoint.go
- main.go
- norecord_launch.go
- opencode.go
- platform_guard.go
- pprof.go
- praxis_mode.go
- proc_unix.go
- proxy_names.go
- server_probe.go
- setup_files.go
- setup_ibac.go
- setup_praxis.go
- setup_probe.go
- setup_runner.go
- setup_step_binaries.go
- setup_step_claudecode.go
- setup_step_cleanup.go
- setup_step_config.go
- setup_step_path.go
- setup_step_service.go
- setup_unsupervised.go
- update_provenance.go
- update_stage.go
- userconfig.go