Metadata-Version: 2.4
Name: marvisx-cli
Version: 0.2.0
Summary: MarvisX OSS — agent-native company-brain CLI runtime (init, status, brief, triage)
Author: MarvisX maintainers
License: BSL-1.1
Project-URL: Homepage, https://justaskmarvis.com
Project-URL: Documentation, https://justaskmarvis.com/docs/getting-started
Project-URL: Source, https://github.com/marvisx/marvisx-oss
Project-URL: Issues, https://github.com/marvisx/marvisx-oss/issues
Project-URL: Changelog, https://github.com/marvisx/marvisx-oss/blob/main/CHANGELOG.md
Keywords: marvisx,cli,bootstrap,wizard,oss,agent,company-brain
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: License :: Other/Proprietary License
Classifier: Operating System :: POSIX :: Linux
Classifier: Operating System :: MacOS :: MacOS X
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
Classifier: Topic :: Utilities
Requires-Python: <3.14,>=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: typer>=0.12
Requires-Dist: rich>=13
Requires-Dist: click>=8
Requires-Dist: pydantic>=2.5
Requires-Dist: pydantic-settings>=2.7.0
Requires-Dist: PyYAML>=6
Requires-Dist: cryptography>=42
Requires-Dist: fastapi>=0.115.0
Requires-Dist: slowapi>=0.1.9
Requires-Dist: cachetools>=5.3.0
Requires-Dist: uvicorn[standard]>=0.34.0
Requires-Dist: uvloop>=0.21.0
Requires-Dist: aiosqlite>=0.20.0
Requires-Dist: PyJWT>=2.10.0
Requires-Dist: bcrypt>=4.2.0
Requires-Dist: email-validator>=2.2.0
Requires-Dist: defusedxml>=0.7.1
Requires-Dist: python-magic>=0.4.27
Requires-Dist: python-multipart>=0.0.18
Requires-Dist: filelock>=3.16.0
Requires-Dist: aiofiles>=24.1.0
Requires-Dist: aiohttp>=3.9.0
Requires-Dist: itsdangerous>=2.1.0
Requires-Dist: pywebpush>=2.0.0
Requires-Dist: py-vapid>=1.9.0
Requires-Dist: anthropic<1.0.0,>=0.96.0
Requires-Dist: openai<2.0.0,>=1.50.0
Requires-Dist: httpx>=0.28.0
Requires-Dist: tenacity<10,>=9.1
Requires-Dist: tree-sitter<0.26,>=0.23.0
Requires-Dist: tree-sitter-python<0.25,>=0.23.0
Requires-Dist: tree-sitter-typescript~=0.23.2
Requires-Dist: pygit2>=1.15.0
Requires-Dist: markdown-it-py>=3.0.0
Requires-Dist: watchfiles>=1.1.0
Requires-Dist: Pillow>=10.0.0
Requires-Dist: openpyxl>=3.1.0
Requires-Dist: mcp>=1.12
Requires-Dist: onnxruntime>=1.18
Requires-Dist: tokenizers>=0.20
Requires-Dist: huggingface-hub>=0.24
Requires-Dist: numpy>=1.26
Requires-Dist: psutil>=5.9.0
Requires-Dist: sqlite-vec>=0.1.6
Provides-Extra: dev
Requires-Dist: pytest>=8; extra == "dev"
Requires-Dist: pytest-cov>=5; extra == "dev"
Dynamic: license-file

# marvis init

Interactive bootstrap wizard for MarvisX OSS. Five prompts (license,
storage, BYOK, first project, recap) reusing the shared `core/wizard/`
state machine so the CLI and the Console `/welcome` route produce
byte-identical settings when given the same answers.

## Install

```bash
pip install marvisx-cli
marvis init
```

Pre-install (clone and run) works too:

```bash
python -m core.cli.marvis_init init
```

## Quick start (interactive)

```bash
marvis init
```

You will be asked:

1. **License** — accept BSL 1.1 (`y`/`n`).
2. **Storage** — projects root path, database backend (`sqlite` or
   `postgres`), and either the SQLite file path or the Postgres DSN.
3. **LLM provider (BYOK)** — `anthropic`, `openai`, `mac_gateway`,
   `bedrock`, or `skip`. API key prompt is hidden input. Mac gateway
   asks for the base URL.
4. **First project** — name, slug, and type (`code`, `work`, `system`).
5. **Recap** — review choices, confirm.

On confirmation the wizard writes:

- `~/.marvis/settings.yaml` — workspace + storage + llm choice (no
  secrets), chmod 600.
- `~/.marvis/master.key` + `~/.marvis/byok.vault` — Fernet-encrypted
  API key store (only if a provider was chosen).
- `<projects_root>/<slug>/project.yaml` — first project seed.

## Non-interactive / CI

```bash
marvis init \
  --accept-bsl \
  --no-interactive \
  --projects-root /var/lib/marvis/projects \
  --db-backend sqlite \
  --db-path /var/lib/marvis/console.db \
  --llm-provider anthropic \
  --llm-api-key "$ANTHROPIC_API_KEY" \
  --project-name "Local Workspace" \
  --project-slug local-workspace \
  --project-type code
```

YAML preset (preferred for repeatable provisioning):

```bash
marvis init --no-interactive --config init.yaml
```

`init.yaml`:

```yaml
welcome:
  bsl_accepted: true
storage:
  projects_root: /var/lib/marvis/projects
  db_backend: sqlite
  db_path: /var/lib/marvis/console.db
llm_provider:
  provider: anthropic
  api_key: sk-ant-...
first_project:
  name: Local Workspace
  slug: local-workspace
  type: code
```

## Dry run

```bash
marvis init --dry-run --accept-bsl --no-interactive ...
```

Prints the planned filesystem writes and the rendered `settings.yaml`
without touching the disk. Exit 0.

## Exit codes

| Code | Meaning |
| --- | --- |
| 0 | Success (or dry-run) |
| 1 | Generic runtime error |
| 2 | User abort at recap confirmation |
| 3 | Validation failure (field-level errors printed) |

## Tests

```bash
python -m pytest tests/test_cli_marvis_init.py
```

Ten cases cover dry-run, non-interactive flags, YAML preset, BYOK vault
write, invalid slug rejection, Postgres backend, interactive prompts via
`CliRunner(input=...)`, BSL gate, and `show-state` JSON dump.

## Relation to `core/scripts/marvis-init.sh`

`marvis-init.sh` (bash) is a deploy bootstrap: copies
`deploy/_template/`, renders `.env` with secrets, runs
`setup-server.sh`, and brings up Docker Compose. It targets server
administrators provisioning a host.

`marvis init` (this Python CLI) is an onboarding wizard: writes
`settings.yaml` + BYOK vault + first project seed in the user's home.
It targets OSS users running MarvisX locally.

The two flows are complementary and will converge in a later phase. Until
then both ship side-by-side.
