CLI Reference

The ai CLI is the primary interface for Apart Intelligence. Install it globally via npm:

npm install -g @apart-tech/apart-intelligence

Knowledge Management

ai add

Create a knowledge node.

ai add "Your content here"
ai add "Content" --type policy --title "PR Policy" --domain quality
ai add "Content" --status approved --by team-lead
FlagDescription
--type <type>Node type (note, architecture, process, policy, decision)
--title <title>Node title (auto-generated if omitted)
-d, --domain <slug>Domain to assign to
--status <status>Initial status (default: draft)
--by <creator>Creator identifier

ai search

Hybrid semantic + keyword search.

ai search "deployment process"
ai search "security" --type policy --limit 5
ai search "api" --include-drafts --workspace eng

ai context

Assemble related knowledge via search + graph traversal.

ai context "incident response"
ai context "onboarding" --depth 2 --max-nodes 50
ai context "deployment" --workspace ops -f markdown

ai get

View a node and its edges. Accepts short ID prefixes.

ai get f69b06e0             # short prefix works
ai get f69b06e0 -f json    # full JSON output

Use --decrypt to view encrypted PII in its original form:

ai get f69b06e0 --decrypt   # decrypt PII fields

ai update

Update a node's content, title, type, or domain.

ai update <id> --title "New Title"
ai update <id> --content "Updated content"
ai update <id> --type architecture --domain architecture

ai delete

Delete a node or edge.

ai delete node <id>        # deletes node and its edges
ai delete edge <id>        # deletes a single edge

ai link

Create an edge between two nodes. Accepts short ID prefixes.

ai link <source> <target>
ai link <source> <target> --rel "depends-on" --weight 0.8

Lifecycle

ai drafts

List all draft nodes pending review.

ai status

Change a node's lifecycle status.

ai status <id> approved    # visible in search
ai status <id> archived    # hidden but preserved
ai status <id> reviewed    # mark as reviewed

Organization

ai domains

ai domains seed            # populate default taxonomy
ai domains list            # show hierarchy
ai domains show technology # details for one domain

ai workspace

ai workspace create eng --description "Engineering" \
  --domains "architecture,development" \
  --types "architecture,policy,module,function,method,class"

ai workspace use eng       # activate filter
ai workspace clear         # deactivate
ai workspace list          # show all workspaces
ai workspace show eng      # details
ai workspace export eng    # export as markdown
ai workspace delete eng

Codebase Integration

ai codebase init

Install Claude Code skills into the current project's .claude/ directory.

cd ~/my-project
ai codebase init
ai codebase status         # check what's installed

ai map

Map source code into the knowledge graph with AST-based function extraction.

ai map .                                        # map current directory
ai map . --status approved --root-node <id>     # approved, connected to root
ai map . --dry-run                               # preview only
ai map . --exclude "test,fixtures"               # skip patterns
FlagDescription
--root-node <id>Connect modules to this node via "contains" edges
--status <status>Node status (default: draft). Use "approved" for immediate searchability
--dry-runAnalyze without creating nodes
--exclude <patterns>Comma-separated patterns to skip
-ySkip confirmation prompt

See the Codebase Mapping guide for the full workflow.

PII Protection

ai pii show

Show PII policy for your organization.

ai pii show

ai pii set

Configure PII policy.

ai pii set encrypt                          # enable encryption
ai pii set encrypt --allow-bypass             # allow per-request bypass
ai pii set encrypt --allowed-types email      # allow emails unencrypted
ai pii set detect-warn                        # detect only, don't encrypt
ai pii set disabled                           # disable PII processing

ai pii test

Scan text for PII without storing anything.

ai pii test "Contact john@example.com or call (555) 123-4567"

ai pii delete

Remove PII policy. Warning: encrypted PII becomes unrecoverable.

ai pii delete

Analysis

ai types                   # node and edge types in use
ai health                  # comprehensive graph health report
ai orphans                 # find unconnected nodes
ai duplicates              # find near-duplicate nodes
ai islands                 # detect disconnected clusters
ai suggest-links           # suggest missing connections
ai validate                # validate edge integrity
ai normalize               # analyze relationship type vocabulary
ai graph                   # interactive HTML visualization

Authentication

ai init                    # setup wizard
ai login                   # authenticate with existing key
ai logout                  # clear credentials
ai whoami                  # check connection

Output Formats

Every command supports -f json for scripting:

ai search "api" -f json | jq '.[].node.title'
ai context "onboarding" -f json | jq '.nodes | length'
ai types -f json