Mossen is a local-first, Rust-native terminal coding agent for developers who want a Claude Code-style workflow with their own model providers.
It implements conversational coding, file editing, shell execution with permissions, slash commands, context management, MCP integration, sub-agents, and terminal rendering in one Rust workspace.
Mossen is not affiliated with Anthropic or Claude Code. The goal is to provide an open Rust implementation of the same class of developer experience, with user-controlled model providers and credentials.
- Rust implementation: the agent runtime, TUI, command system, tool execution, provider bridge, and harnesses live in one Rust workspace.
- Provider flexibility: use OpenAI-compatible Chat Completions, OpenAI Responses-compatible endpoints, or Anthropic-compatible endpoints.
- Local-first configuration: model keys are stored in the user's local Mossen config, not in the repository.
- Terminal-native workflow: interactive TUI, streaming output, permissions, slash commands, history, compaction, and task feedback are first-class.
- Engineering-agent surface: built-in tools for reading, editing, searching, shell execution, planning, MCP, and sub-agent task orchestration.
- Testable release path: harness scripts and smoke tests cover core runtime behavior instead of relying only on manual demos.
Current public release: V1.1.0. Current development target: V1.2 Reliability & Production UX.
V1.1 is the external-user-ready release. It focuses on a five-minute source install path, clearer model configuration guidance, provider compatibility checks, sub-agent lifecycle feedback, and focused TUI scroll/copy/input coverage.
See docs/RELEASE_NOTES_V1.1.0.md for the V1.1 release notes and docs/LAUNCH.md for copy-ready launch material.
- Rust 1.80 or newer
- macOS or Linux
- Git
- Recommended:
rgfor fast repository search
Clone and install the mossen binary from source:
git clone https://github.com/Allen091080/rustmossen.git
cd rustmossen
cargo install --path crates/mossen-cli --bin mossen --lockedAdd your first model profile. Use your own endpoint, model name, and API key:
mossen --add-model-profile my-model \
--provider openai-compatible \
--baseURL https://api.example.com/v1 \
--model your-model-name \
--apiKey "$YOUR_API_KEY"Activate and test it:
mossen --set-model-profile my-model
mossen --test-model-profile my-model --timeout 30000Start Mossen in your project:
mossen --cwd /path/to/projectInside the TUI, run /doctor if the model is not configured or a provider call fails. /doctor reports missing profiles, invalid active profiles, partial custom-backend environment variables, and the next command to run without printing raw API keys or base URLs.
cargo build --release -p mossen-cli --bin mossenRun the release binary:
./target/release/mossenFor development, use the repository launcher:
scripts/start-mossen.shThe launcher rebuilds automatically when Rust sources changed. To skip the build when a debug binary already exists:
MOSSEN_START_BUILD=never scripts/start-mossen.shInstall locally from the checkout:
cargo install --path crates/mossen-cli --bin mossen --lockedInteractive mode:
mossenOne-shot mode:
mossen --oneshot "Explain the current repository structure"Stream JSON output:
mossen --oneshot "List the test commands for this project" --emit stream-jsonUse a specific working directory:
mossen --cwd /path/to/projectInside the TUI, use /help to inspect available slash commands. For long-running
work, /goal <objective> sets a persistent thread goal; /goal shows current
progress, /goal pause pauses it, /goal resume resumes it, /goal edit <objective> updates it, and /goal clear removes it.
Mossen stores model profiles in:
~/.mossen/settings.json
Do not commit this file. It can contain API keys.
Create a profile:
mossen --add-model-profile my-model \
--provider openai-compatible \
--baseURL https://api.example.com/v1 \
--model your-model-name \
--apiKey "$YOUR_API_KEY"Activate it:
mossen --set-model-profile my-modelCheck configured profiles:
mossen --list-model-profilesTest a profile:
mossen --test-model-profile my-model --timeout 30000Supported provider values:
openai-compatibleopenai-responsesanthropic
See docs/CONFIGURATION.md for the full configuration guide and an example settings file. A Chinese version is available at docs/CONFIGURATION.zh-CN.md.
- Never commit
~/.mossen/settings.json, project.mossen/,.env, or files containing real API keys. - Public examples must use placeholders such as
<your-api-key>. - Before publishing, run the sensitive-data scan in docs/OPEN_SOURCE_CHECKLIST.md.
- If you use project-scoped config with
--scope project, make sure the project.mossen/directory remains ignored.
cargo fmt --all -- --check
cargo check --workspace
cargo test --workspace
git diff --checkTargeted harness scripts live under scripts/harness_*.py. Run the narrow harness for the subsystem you changed before sending a PR.
crates/mossen-cli CLI entrypoint, TUI launch, stream rendering
crates/mossen-agent agent runtime, provider bridge, context, hooks
crates/mossen-tools built-in tools and sub-agent task tools
crates/mossen-commands slash command implementations
crates/mossen-tui terminal UI and rendering model
crates/mossen-mcp MCP integration
crates/mossen-utils shared config, auth, filesystem and runtime helpers
scripts/ smoke tests, harnesses, release checks
docs/ public user and maintainer documentation
examples/ non-secret configuration examples
Mossen is a local CLI project. Hosted service features, team sync, remote attach, and account-managed workflows are not part of the current public release unless they are wired to a real public implementation.
MIT. See LICENSE.