# SDLC CLI Reference

The `sdlc` CLI provides deterministic SDLC orchestration within project pods.

## Global Flags

| Flag | Description |
|------|-------------|
| `--root` | Project root directory (default: auto-detect) |
| `--json` | Output as JSON |

## Commands

### sdlc init

Initialize SDLC in a project.

```bash
sdlc init --project "Project Name" [--type go|node|python]
```

### sdlc state

Show the global SDLC state.

```bash
sdlc state
```

### sdlc next

Get the classifier's recommended next action.

```bash
sdlc next [--feature <slug>]
```

Returns the action type, message, and command to execute.

### Feature Management

#### sdlc feature create

Create a new feature.

```bash
sdlc feature create <slug> --title "Feature Title"
```

#### sdlc feature list

List all features.

```bash
sdlc feature list
```

#### sdlc feature show

Show feature details.

```bash
sdlc feature show <slug>
```

#### sdlc feature transition

Move feature to a new phase.

```bash
sdlc feature transition <slug> <phase>
```

Valid phases: draft, specified, planned, ready, implementation, review, audit, qa, merge, released

#### sdlc feature block

Block a feature with a reason.

```bash
sdlc feature block <slug> --reason "Waiting for dependency"
```

#### sdlc feature unblock

Remove all blockers from a feature.

```bash
sdlc feature unblock <slug>
```

#### sdlc feature delete

Delete a feature.

```bash
sdlc feature delete <slug> [--force]
```

### Artifact Management

#### sdlc artifact status

Show artifact statuses for a feature.

```bash
sdlc artifact status <slug>
```

#### sdlc artifact create

Register a new artifact.

```bash
sdlc artifact create <slug> <type>
```

Types: spec, design, tasks, qa_plan, review, audit, qa_results

#### sdlc artifact approve

Approve an artifact.

```bash
sdlc artifact approve <slug> <type>
```

#### sdlc artifact reject

Reject an artifact.

```bash
sdlc artifact reject <slug> <type>
```

### Task Management

#### sdlc task list

List tasks for a feature.

```bash
sdlc task list <slug>
```

#### sdlc task add

Add a new task.

```bash
sdlc task add <slug> --title "Task title"
```

#### sdlc task start

Start working on a task.

```bash
sdlc task start <slug> <task-id>
```

#### sdlc task complete

Mark a task as complete.

```bash
sdlc task complete <slug> <task-id>
```

#### sdlc task block

Mark a task as blocked.

```bash
sdlc task block <slug> <task-id>
```

### Branch Management

#### sdlc branch create

Create a feature branch.

```bash
sdlc branch create <slug>
```

Creates both the git branch and the branch manifest.

#### sdlc branch status

Show branch status and merge checklist.

```bash
sdlc branch status <slug>
```

#### sdlc branch sync

Sync feature branch with base branch.

```bash
sdlc branch sync <slug>
```

### Merge and Archive

#### sdlc merge

Merge a feature branch after all gates pass.

```bash
sdlc merge <slug> [--strategy squash|merge]
```

This command:
1. Checks merge readiness (all gates passed)
2. Checkouts the main branch
3. Merges/squashes the feature branch
4. Creates the commit
5. Updates the branch manifest
6. Transitions feature to released

#### sdlc archive

Archive a released feature.

```bash
sdlc archive <slug>
```

### Query Commands

#### sdlc query blocked

List blocked features.

```bash
sdlc query blocked
```

#### sdlc query ready

List features ready for work.

```bash
sdlc query ready
```

#### sdlc query needs-approval

List features awaiting approval.

```bash
sdlc query needs-approval
```

### Configuration

#### sdlc config show

Show current configuration.

```bash
sdlc config show
```

#### sdlc config set

Set a configuration value.

```bash
sdlc config set <key> <value>
```

Keys:
- `project.name`
- `project.type`
- `branches.main`
- `branches.feature_prefix`
- `compliance.require_approvals` (true/false)
- `compliance.require_branch` (true/false)
- `compliance.require_qa` (true/false)
