agex.dev
CLI

Commands

Full reference for every agex CLI command.

agex init

Detect your project's tech stack and generate an agex.toml manifest.

agex init

The CLI inspects your package.json, lock files, config files, and directory structure to determine which agentic tools you use and what your stack looks like, then writes a starter agex.toml.


Search the hub for artifacts.

agex search <query>
agex search "next.js clerk"
agex search "mcp postgres"

Results show the artifact reference, type, vote count, and description.


agex info

Show details for a specific artifact.

agex info @username/slug
agex info @rkrebs/nextjs-claude

Displays title, type, category, tags, version count, vote count, and the artifact content.


agex add

Add a hub artifact to agex.toml and immediately sync it to disk.

agex add @username/slug
agex add @rkrebs/nextjs-claude
agex add @rkrebs/nextjs-claude@2    # pin to a specific version

This is equivalent to manually adding the entry to agex.toml and then running agex sync. The artifact files are written to disk according to the placement rules.


agex sync

Fetch all remote artifacts listed in agex.toml and write them to disk.

agex sync
  • Downloads each artifact from the hub
  • Writes files according to platform placement rules
  • Merges JSON-type artifacts (MCP servers, hooks) without overwriting existing entries
  • Skips local: references (those are only synced on agex push .)

Run this after cloning a repo that has an agex.toml, or after manually editing the manifest.


agex remove

Remove an artifact from agex.toml and delete its materialized files from disk.

agex remove @username/slug
agex remove @rkrebs/nextjs-claude

For merge-json artifacts (MCP servers, hooks), only the entries tagged with that artifact's ref are removed — other entries in the same file are preserved.


agex clean

Remove all files that were materialized by agex sync, without modifying agex.toml.

agex clean

Useful for resetting your workspace before a fresh agex sync, or for removing artifacts that are no longer tracked.


agex push

Publish a file as an artifact, or push your entire agex.toml as a project.

Push a single artifact

agex push <file>
agex push CLAUDE.md
agex push .claude/skills/deploy/SKILL.md

The CLI auto-detects the artifact type from the filename:

Filename patternDetected type
CLAUDE.mdclaude-md
.cursorrules / *cursorrule*cursorrules
AGENTS.mdagents-md
*copilot*copilot
*skill*skill-action
*mcp*mcp-server
*hook*hook

If the type can't be detected, you'll be prompted interactively.

Options:

FlagDescription
--title <title>Artifact title (used as the slug)
--description <desc>Short description
--type <type>Override detected artifact type
--category <cat>Override detected category
--tag <tags>Stack tags, comma-separated (e.g. nextjs,typescript)
--tool <tools>Tool tags, comma-separated (e.g. claude-code,cursor)
--changelog <msg>Changelog message when updating an existing artifact

If the artifact already exists (matched by slug), it is updated — a new version is created.

Push a directory (multi-file artifact)

agex push ./my-skill/
agex push ./my-skill/ --title "My MCP Skill" --type skill-action

When the path is a directory, the CLI:

  1. Walks the tree (skipping .git, node_modules, __pycache__, etc.)
  2. Reads all text files
  3. Bundles them as a multi-file artifact
  4. The primary file is the first .md found (or configurable via prompts)

Push a project

agex push .

Pushes the current directory as a project using agex.toml. The CLI:

  1. Uploads any local: file references as artifacts (creating or updating them)
  2. Creates or updates the project on the hub
  3. Links all artifact refs (both remote and newly pushed local) to the project

agex run

Fetch an artifact and output its content to stdout. Designed for piping into agents.

agex run <ref>
agex run @community/go-refactoring
agex run @user/mcp-builder --version 2

Options:

FlagDescription
--version <n>Use a specific version
--file <path>Output a specific file from a multi-file artifact
--allOutput all files concatenated with path headers
--no-headerSkip the header comment, output raw content only

Examples:

# Pipe a skill into Claude Code
agex run @community/go-refactoring | claude -p "refactor this file"

# Output a specific file from a multi-file artifact
agex run @user/mcp-builder --file scripts/eval.py

# Output all files
agex run @user/mcp-builder --all | claude -p "review this skill"

# Raw output without header
agex run @user/config --no-header > CLAUDE.md

When piped (stdout is not a TTY), agex run outputs a lightweight header comment followed by the content. In interactive mode, it shows formatted output with tips.


agex status

Show the status of your agentic coding environment — which artifacts are synced, which are outdated, which have missing files.

agex status

Output:

agex status
Project: my-app
Platforms: claude-code, cursor

  ✓ rules/nextjs         @rkrebs/nextjs-rules v3
  ⚠ skills/mcp-builder   @anthropic/mcp-builder v2 (v3 available)
  ✗ hooks/lint           @company/eslint-hook v1 — files missing, run agex sync

agex update

Check for and apply updates to all artifacts in your agex.toml.

agex update              # update all to latest
agex update --check      # dry run — show what would update
agex update @user/slug   # update a specific artifact

Respects pinned versions — artifacts with @3 won't be updated past v3. Shows changelogs for each update.


agex login

Authenticate with GitHub via device flow.

agex login

Prints a code, opens GitHub in your browser, and waits for you to authorize. No tokens to manage — the session is stored at ~/.config/agex/auth.json.


agex logout

Clear your local authentication session.

agex logout

agex whoami

Show the currently authenticated user.

agex whoami

On this page