Skip to content

CLI Commands

Command Structure

Moss has 17 top-level commands organized by domain:

Core Operations

CommandDescription
viewView directory/file/symbol structure
editStructural code modifications
analyzeCodebase analysis (16 subcommands)
text-searchFast ripgrep-based text search

Infrastructure

CommandDescription
indexManage file index
daemonBackground process management
grammarsTree-sitter grammar management
initInitialize moss in a directory
updateSelf-update

Ecosystem Integration

CommandDescription
sessionsAgent session logs (Claude Code, Codex, Gemini, Moss)
packagePackage management (info, list, tree, why, outdated, audit)
toolsExternal tool orchestration (lint, test)
serveServer protocols (mcp, http, lsp)
generateCode generation (client, types)

Utility

CommandDescription
aliasesList filter aliases
historyShadow git edit history
scriptLua script management

Design Principles

One namespace per concept

  • aliases not filter aliases (filter does nothing else)

Group by domain, not by verb

  • sessions, grammars list, package list
  • Not: list-sessions, list-grammars, list-packages
  • analyze has 16 subcommands because they're all "analysis"
  • Better than 16 top-level commands

list as subcommand, not flag

  • Consistent: grammars list, script list, daemon list, package list

Positional args for primary targets

  • moss view src/main.rs not moss view --file src/main.rs

Output Formats

All commands support these global flags:

FlagDescription
--jsonOutput as JSON
--jq EXPRFilter JSON with jq expression
--prettyHuman-friendly output with colors
--compactLLM-optimized output

Configuration

Configuration in .moss/config.toml or ~/.config/moss/config.toml:

toml
[daemon]
enabled = true

[index]
enabled = true

[aliases]
tests = ["*_test.go", "**/__tests__/**"]

[serve]
http_port = 8080

See Also

  • Individual command docs in this directory
  • docs/cli-design.md for design rationale