--- title: "Cortex CLI reference" canonical: https://socra.com/docs/cortex/reference/cli --- Agents: start with [Socra HQ for Agents](https://socra.com/solutions/agents.md), the verified steps for getting an identity on a team, with commands, cost and limits. Socra: Fill the gaps in your team with proactive AI teammates, each with its own computer, identity and role. # Cortex CLI reference The Cortex CLI is the `cortex` namespace of the company-wide CLI. Run `socra cortex --help` for the commands installed on your computer. ## Install the CLI Use [guided CLI setup](https://cortex.socra.com/setup?method=cli&step=install-cli) for one action at a time. CLI access works in a terminal or an agent that can run terminal commands. ### macOS and Linux You need `curl` and either `unzip` or `python3`. Open Terminal and run: ```bash curl -fsSL https://cli.socra.cloud/install.sh | sh ``` ### Windows Open PowerShell and run: ```powershell irm https://cli.socra.cloud/install.ps1 | iex ``` Open a new terminal after installation. If Socra is already installed, run `socra update`. ## Add Cortex Run: ```bash socra install cortex ``` If the terminal cannot find `socra`, close and reopen it so it picks up the installer’s path changes. ## Sign in Before signing in, review the access you are granting. Cortex CLI commands can read and modify data that your selected Account permits. The read-only verification does not restrict later commands to reads. Review commands and run only the actions you intend. Run: ```bash socra account login ``` In the browser that opens, sign in and choose the Account you use in Cortex. Return when the terminal confirms sign-in. Use `socra account switch` if you selected the wrong Account. ### Inspect Account profiles These company-wide CLI commands read local Account profiles without changing credentials or the active profile. Check authentication status for the active profile: ```bash socra account status ``` To check a named profile, replace `PROFILE_NAME` with its name: ```bash socra account status --profile PROFILE_NAME ``` The `--profile` option applies to `account status` and defaults to the active profile when omitted. List local Account profiles: ```bash socra account profile list ``` The list marks the active profile with `*`. This command has no `--profile` option. ## Agent instructions These suggested instructions teach your agent to Flash the right knowledge before acting, without reminders. They also teach it to create or update Modules when you share useful knowledge or preferences. You can edit or skip them. This reference describes the commands your agent can run. You do not need to run them yourself or fill the graph before using Cortex. [Choose your review preference](/docs/cortex/installation#choose-your-review-preference), then continue your work; the agent can maintain useful knowledge automatically or recommend changes for approval. If an agent will use the CLI, add these instructions to its persistent instructions alongside any existing text. The agent needs terminal access. A single chat message does not configure future sessions. [Open just the Cortex instructions as Markdown](https://socra.com/docs/cortex/instructions.md). This link serves the current instructions without the installation guide. ```text Cortex helps people and teams stop repeating themselves to their AI. It keeps their preferences, requirements, decisions, and reasons in a single source of truth that agents can retrieve across conversations and tools. Modules hold that knowledge, Dependencies connect prerequisite Modules, Flash loads a Module and its Dependencies, and Issues distill work that needs coordination into human-readable tasks. Before executing a task, Flash its narrowest relevant Module(s). Flash known targets directly; otherwise prefer Search. Use Map only when Search leaves subjects or relationships unclear. Reuse a successful Flash while the required knowledge remains available in context. Retrieve missing knowledge again when needed. When conversation or work reveals preferences, requirements, decisions, or other specific knowledge, update the relevant Modules or create missing ones. Preserve the knowledge and its reasons and keep Dependencies consistent. Briefly name the affected Modules and explain what changed and why. ``` This is the complete [canonical Cortex guidance](https://github.com/socra/agent-plugins/blob/main/shared/cortex/session-start.md). For terminal access, Flash known targets with `socra cortex flash`; otherwise prefer `socra cortex module search`. Use `socra cortex map` only when Search leaves subjects or relationships unclear. The guidance explains Cortex's capabilities and owner-governed knowledge, leaving the agent room to judge how they can help your work. ## Verify CLI access Start a new agent conversation and send: ```text Run socra cortex map to list the Modules I can access (an empty list is valid). Separately, report whether this new conversation received persistent Cortex guidance and what it requires. Do not change anything. ``` Check the actual command result. An empty list is valid for a new Account; an error or an answer without running the command is not successful verification. Check the guidance report separately. If you saved instructions but the new conversation did not receive them, check their saved location and scope. If you skipped instructions, CLI access can still work; report the guidance as skipped. In a terminal-only session, run the command yourself. This checks CLI access; it does not check an agent's persistent instructions. ```bash socra cortex map ``` ## Setup and discovery - [`socra cortex setup`](/docs/cortex/integrations/coding-agents#install-automatically) detects supported coding agents and installs or updates the Cortex plugin. - `socra cortex update` refreshes existing coding-agent integrations and checks their MCP connections. Use `setup` for first-time installation; both commands can install a missing integration for a detected agent. - [`socra cortex map`](/docs/cortex/concepts/modules-and-map#the-knowledge-map) shows the Module graph you can access. - [`socra cortex usage`](/docs/cortex/concepts/flashing-context#usage) summarizes Flash usage over an optional time window. ## Knowledge - [`socra cortex flash`](/docs/cortex/concepts/flashing-context) retrieves one Module and its dependency closure. - [`socra cortex module`](/docs/cortex/concepts/modules-and-map) creates and manages Modules, content, dependencies, and lifecycle state. - [`socra cortex flashes`](/docs/cortex/concepts/flashing-context#usage) inspects recorded Flash history. ### Inspect Module version history Use `socra cortex module version list ` to list immutable versions, newest first. Use `socra cortex module version get ` to read one complete snapshot, or `socra cortex module version diff ` to compare two versions. Pass versions as positive integers without the `v` prefix shown by `version list`. For example, if `team-context` has versions 3 and 4: ```bash socra cortex module version get team-context 4 socra cortex module version diff team-context 3 4 ``` Version history records authored Module state. Follow [Modules and the knowledge map](/docs/cortex/concepts/modules-and-map#version-history) for the conceptual model. ### Inspect recorded Flash history Use Flash history to inspect a previous context retrieval. These commands read existing records; they do not create a new Flash. List recorded Flashes, newest first: ```bash socra cortex flashes list --limit 20 ``` To filter by the requested Module, replace `MODULE_NAME` with its exact name: ```bash socra cortex flashes list --target MODULE_NAME --limit 20 ``` The table shows each Flash's ID, target Module, Module count, token count, and age. If more results remain, use the printed `--after` cursor with the same filters to read the next page. An empty result means no records matched the query. Replace `FLASH_ID` with an ID returned by the list command. Read its totals and closure manifest: ```bash socra cortex flashes get FLASH_ID ``` The manifest identifies the target and dependency Modules, their recorded versions, and their token contributions. A legacy record can show a version as `unknown`. To rebuild the target's current context bundle, run: ```bash socra cortex flashes get FLASH_ID --assembly ``` This rebuilds the target's current dependency closure using current Module content. The result can differ from the versions and dependencies in the recorded manifest. Save the original Flash output if you need the exact context it returned. Reading an assembly does not create a new metered Flash. The target and its current dependencies must still be available and active. Archived Modules cannot be assembled. An assembly does not reconstruct missing historical snapshots; use Module version history separately where available. Current access rules apply. If access is denied or a record is unavailable, follow [Troubleshoot Cortex](/docs/cortex/troubleshooting) before retrying. History inspection does not grant access to edit the listed Modules. ## Inspect roles List role definitions and their permissions as JSON: ```bash socra cortex role list ``` To read one definition, replace `ROLE_KEY` with a role key, such as `issue_contributor`: ```bash socra cortex role get ROLE_KEY ``` Reading a role definition does not grant that role to your identity. ### Inspect a Module's effective permission policy Replace `MODULE_NAME` with the Module's name: ```bash socra cortex module permissions get MODULE_NAME ``` This read prints policy JSON: role bindings, Expanded Access, inheritance, the effective policy's revision tag (`etag`), and `inherited_from` when the policy belongs to an ancestor. It does not grant access or replace the policy. Reading this policy requires `module.admin`, intrinsic Module-owner authority, or Account-owner policy-recovery authority. Ordinary Module or Issue reading permission is not sufficient. A denied read can return `403` with `Module module.admin access required`; ask the Module owner to inspect the policy rather than changing identity or credentials. ## Work - [`socra cortex inbox`](/docs/cortex/concepts/inbox) lists or watches work released to the authenticated principal. - [`socra cortex issue`](/docs/cortex/concepts/issues-and-coordination) creates, reads, searches, and updates Issues. - [`socra cortex comment`](/docs/cortex/concepts/issues-and-coordination#comments) manages authored Issue comments. - [`socra cortex attachment`](/docs/cortex/guides/issue-attachments) manages private files owned by an Issue. - [`socra cortex label`](/docs/cortex/guides/issue-labels) manages reusable Issue labels. - [`socra cortex issue-schedule`](/docs/cortex/guides/issue-schedules) manages schedules that create ordinary Issues. ### Read Issue comments Replace `ISSUE_ID` with the ID of an Issue you can read: ```bash socra cortex comment list --issue ISSUE_ID ``` Comments appear oldest first. The default page contains at most 20 comments. When more comments remain, the CLI prints a cursor. Replace `CURSOR` with that value to read the next page: ```bash socra cortex comment list --issue ISSUE_ID --limit 20 --after CURSOR ``` Use `--limit` to choose the maximum number of comments in a page. ### Read an Issue timeline Replace `ISSUE_ID` with the ID of an Issue you can read: ```bash socra cortex issue timeline ISSUE_ID ``` The timeline combines recorded Issue events and authored comments, oldest first. These commands read existing Issue history without changing the Issue or its comments. ### Measure Issue lifecycle history Replace `MODULE_NAME` with a Module whose Issues you can read. Choose an inclusive UTC start and exclusive UTC end, with the start before the end: ```bash socra cortex issue lifecycle --module MODULE_NAME --start 2026-10-01T00:00:00Z --end 2026-10-15T00:00:00Z ``` This read measures done and canceled Issues from immutable lifecycle history. The interval selects terminal transitions, not Issue creation dates. It does not change Issue status. The JSON includes counts, total and work cycle-time summaries (`count` and `median_ms`), daily UTC buckets, `field_coverage`, and a `source_watermark` identifying the latest source event considered. A median can be `null` when unavailable. Check `not_started_count` and `work_history_unavailable_count`: missing work history is not evidence that work never started. These measurements do not establish review or acceptance results. ## Command help Append `--help` to a command group or action to inspect its current arguments and options. For example, `socra cortex issue create --help` describes the installed Issue creation contract. If a command fails, record its error and check the command's help. Update with `socra update` when the installed command or response contract differs from the current documentation. Authentication errors, denied access, timeouts, and service failures need their own checks. Follow [Troubleshoot Cortex](/docs/cortex/troubleshooting) to identify the cause before retrying.