npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@mindifyai/cortex-cli

v0.1.5

Published

Command-line interface for Cortex.

Downloads

593

Readme

Cortex CLI

A complete command-line companion for Mindify Cortex: browser login, hosted model chat, autonomous goal loops, repository-aware agent prompts, a local Pi coding harness, and a polished terminal UI inspired by Claude Code, Codex CLI, and Gemini CLI — with deep links back into the Cortex app.

Install

npm install -g @mindifyai/cortex-cli

Equivalent package-manager commands:

pnpm add -g @mindifyai/cortex-cli
yarn global add @mindifyai/cortex-cli
bun add -g @mindifyai/cortex-cli

After installation, run Cortex directly:

cortex --help

Quick start

cortex login --base-url https://cortex.mindifyai.dev
cortex doctor
cortex models
cortex ask "Summarize this repository"
cortex goal "Add unit tests for the auth module"
cortex chat

For non-interactive environments, pass CORTEX_TOKEN and optionally CORTEX_BASE_URL instead of using cortex login.

Commands

| Command | Description | | --- | --- | | cortex login [--base-url <url>] | Sign in through the browser callback flow. | | cortex logout | Remove the saved local session. | | cortex status | Show whether the CLI is signed in. | | cortex doctor | Check Node, auth, server, profile, and model API reachability. | | cortex models | Print hosted model IDs returned by Cortex. | | cortex threads | List your recent Cortex app threads with web links. | | cortex open [thread-id] | Open the Cortex app (or a specific thread) in the browser. | | cortex config get [key] | Print the saved CLI configuration. | | cortex config set <key> <value> | Save a config value, such as defaultModel openai/gpt-4.1. | | cortex config unset <key> | Remove a saved config value. | | cortex ask [--model provider/model] <question> | Ask one non-interactive question. | | cortex chat [--model provider/model] | Open the interactive TUI. | | cortex goal [options] <goal> | Run an autonomous agent loop until the goal is done. | | cortex agent | Send a project map and coding-agent prompt to Cortex. | | cortex explain <file> | Ask Cortex to explain a file. | | cortex edit <file> <instruction> | Ask Cortex for a safe patch suggestion. | | cortex pi [options] [prompt] | Run the local Pi coding-agent harness. |

Top-level slash aliases work too, for example cortex /status, cortex /models, cortex /ask "question", cortex /goal "…", and cortex /chat.

Goal loops

cortex goal (and /goal inside the TUI) runs an agent loop instead of a single turn: the model works one step per iteration and reports GOAL_STATUS: CONTINUE, DONE, or BLOCKED at the end of each reply. The loop keeps stepping until the goal is done, the model is blocked, or the iteration budget (goalMaxIterations, default 8) runs out.

cortex goal "Write release notes for the last five commits"
cortex goal --model anthropic/claude-sonnet-5 --max-iterations 12 "Refactor the config module"

By default the loop runs against hosted Cortex chat with a compact project map attached. Pass --pi to run the loop on the local Pi coding harness instead, where the agent can actually read files — and, with the safety flags, edit files and run commands between iterations:

CORTEX_ANTHROPIC_API_KEY=sk-ant-... cortex goal --pi --allow-writes "Fix the failing test"

The command exits non-zero when the goal did not finish (blocked or max-iterations), so it can gate scripts and CI steps.

Interactive TUI

cortex chat opens a full terminal experience with a Cortex banner, an interactive command palette, streaming markdown rendering, a thinking spinner, tab-completed slash commands, model switching, goal loops, thread handoff to the Cortex app, elapsed response timing, and a repository-aware agent mode.

Type / and press Enter to open the command palette: type to filter, move with ↑/↓, select with Enter, cancel with Esc. In non-interactive terminals the palette falls back to a numbered list.

| Slash command | Description | | --- | --- | | / | Open the selectable command palette. | | /help | Show all TUI commands and shortcuts. | | /status | Show server, model, thread ID, turn count, and web link. | | /goal <goal> | Run an agent loop until the model reports DONE. | | /agent <goal> | Attach a compact git-tracked project map to a coding-agent prompt. | | /pi <prompt> | Run the local Pi harness from inside chat. | | /model [provider/name] | Switch models — bare /model opens an interactive picker. | | /models | List hosted Cortex models. | | /threads | List your recent Cortex app threads. | | /resume [thread-id] | Continue a Cortex app thread in the CLI (picker when no ID). | | /web | Print this thread's link in the Cortex app. | | /new | Start a fresh chat thread. | | /clear | Redraw the interface. | | /exit | Quit. |

Press Tab after typing / to complete commands. End a line with \ to continue a multiline prompt. Failed requests print an error and keep the session alive, and piped stdin works for scripted sessions.

Cortex app connection

CLI chat threads live in the same account as the Cortex app, so a conversation can move fluidly between the two:

  • /threads (or cortex threads) lists your recent app conversations.
  • /resume continues an app conversation in the terminal.
  • /web and /status print the https://…/chat/<thread> deep link for the current CLI thread so you can pick it up in the app.
  • cortex open [thread-id] opens the app (or a thread) in the browser.

Local Pi Harness

cortex pi runs the local Pi coding-agent harness against the current workspace. It uses CORTEX_ANTHROPIC_API_KEY or ANTHROPIC_API_KEY.

CORTEX_ANTHROPIC_API_KEY=sk-ant-... cortex pi
cortex pi --model anthropic:claude-sonnet-4-6 "Review this project"
cortex pi --allow-writes "Patch the failing test"
cortex pi --allow-writes --allow-commands "Run tests and fix failures"

By default, Pi mode is read-only: it can read, list, find, and grep files. File edits require --allow-writes; shell commands require --allow-commands.

Configuration

Configuration is stored in ~/.config/mindify-cortex/config.json with private file permissions. Useful settings include:

cortex config set baseUrl https://cortex.mindifyai.dev
cortex config set defaultModel openai/gpt-4.1
cortex config set maxContextBytes 200000
cortex config set goalMaxIterations 12
cortex config set piAgentModel claude-sonnet-4-6
cortex config get

Development

cd cortex-cli
npm install
npm run build
npm test