<!-- source: https://deepwiki.com/qhkm/zeptoclaw/4.5-management-commands -->

# Management Commands

- Dockerfile
- src/auth/codex_import.rs
- src/auth/mod.rs
- src/auth/oauth.rs
- src/auth/refresh.rs
- src/auth/store.rs
- src/cache/response_cache.rs
- src/cli/daemon.rs
- src/cli/doctor.rs
- src/cli/memory.rs
- src/cli/skills.rs
- src/cli/status.rs
- src/cli/update.rs
- src/memory/hygiene.rs
- src/memory/longterm.rs
- src/memory/snapshot.rs
- src/security/pairing.rs
- src/skills/github_source.rs
- src/skills/mod.rs
- src/tools/longterm_memory.rs

This page documents ZeptoClaw's operational and administrative CLI commands for managing memory, conversation history, skills, tools, authentication, system health, and updates. For core agent execution, see **4.2 Agent Commands**. For gateway server operations, see **4.3 Gateway Commands**. For initial setup and configuration, see **4.4 Configuration Commands**.

## Overview

Management commands provide runtime introspection, state manipulation, and system maintenance capabilities. They are organized into five functional categories:

All management commands read from `~/.zeptoclaw/config.json` and operate on state directories (`~/.zeptoclaw/memory/`, `~/.zeptoclaw/sessions/`, `~/.zeptoclaw/skills/`).

**Sources:** [src/cli/mod.rs34-271](https://github.com/qhkm/zeptoclaw/blob/2c743d31/src/cli/mod.rs#L34-L271) [src/cli/status.rs9-13](https://github.com/qhkm/zeptoclaw/blob/2c743d31/src/cli/status.rs#L9-L13)

## Command Routing Architecture

The CLI uses `clap` for argument parsing, dispatching commands to specific handlers within the `src/cli/` module.

Title: CLI Command Dispatch Flow

```

```

**Sources:** [src/cli/mod.rs525-670](https://github.com/qhkm/zeptoclaw/blob/2c743d31/src/cli/mod.rs#L525-L670) [src/cli/status.rs181-185](https://github.com/qhkm/zeptoclaw/blob/2c743d31/src/cli/status.rs#L181-L185) [src/memory/longterm.rs93-94](https://github.com/qhkm/zeptoclaw/blob/2c743d31/src/memory/longterm.rs#L93-L94)

## Memory Management

The `memory` command provides CRUD operations and maintenance for the `LongTermMemory` key-value store. This store persists facts, preferences, and learnings across sessions.

### Subcommands

### Implementation Details

- Injection Protection : The set command (and the underlying LongTermMemory::set function) scans values for prompt injection patterns using sanitizer::check_injection src/memory/longterm.rs 137-143
- Decay Scoring : Entries decay over time based on age and importance. Pinned entries (category "pinned") always return a score of 1.0 to prevent expiration src/memory/longterm.rs 56-69
- Persistence : Memories are stored as a JSON file at ~/.zeptoclaw/memory/longterm.json src/memory/longterm.rs 93-94

**Sources:** [src/cli/memory.rs9-25](https://github.com/qhkm/zeptoclaw/blob/2c743d31/src/cli/memory.rs#L9-L25) [src/memory/longterm.rs122-174](https://github.com/qhkm/zeptoclaw/blob/2c743d31/src/memory/longterm.rs#L122-L174) [src/memory/snapshot.rs12-45](https://github.com/qhkm/zeptoclaw/blob/2c743d31/src/memory/snapshot.rs#L12-L45)

## Skills Management

The `skills` command manages the lifecycle of Markdown-based skills. Skills are discovered in the local workspace or can be installed from remote sources.

### Subcommands

### Skill Discovery Logic

The `SkillsLoader` scans `~/.zeptoclaw/skills/` for `.md` files containing YAML frontmatter [src/skills/loader.rs40-65](https://github.com/qhkm/zeptoclaw/blob/2c743d31/src/skills/loader.rs#L40-L65) The `search` command uses `github_source::search_github` to query repositories with specific topics like `zeptoclaw-skill` [src/skills/github_source.rs184-190](https://github.com/qhkm/zeptoclaw/blob/2c743d31/src/skills/github_source.rs#L184-L190)

**Sources:** [src/cli/skills.rs103-187](https://github.com/qhkm/zeptoclaw/blob/2c743d31/src/cli/skills.rs#L103-L187) [src/skills/github_source.rs12-29](https://github.com/qhkm/zeptoclaw/blob/2c743d31/src/skills/github_source.rs#L12-L29)

## Authentication and Provider Status

The `auth` command handles OAuth 2.0 PKCE flows for LLM providers, while `status` and `provider` provide introspection into the current configuration.

### Authentication Subcommands

### Credential Resolution Logic

Title: Provider Credential Resolution (Code Entity Space)

```

```

**Sources:** [src/cli/status.rs20-39](https://github.com/qhkm/zeptoclaw/blob/2c743d31/src/cli/status.rs#L20-L39) [src/auth/mod.rs26-38](https://github.com/qhkm/zeptoclaw/blob/2c743d31/src/auth/mod.rs#L26-L38) [src/auth/store.rs20-50](https://github.com/qhkm/zeptoclaw/blob/2c743d31/src/auth/store.rs#L20-L50) [src/providers/mod.rs110-140](https://github.com/qhkm/zeptoclaw/blob/2c743d31/src/providers/mod.rs#L110-L140)

## System Diagnostics ( doctor )

The `doctor` command performs a suite of checks to ensure the environment is correctly configured for agent execution.

### Diagnostic Categories

- Config : Validates config.json structure and values (e.g., temperature ranges) src/cli/doctor.rs 51-66
- Workspace : Verifies that the workspace directory is writable by performing a file probe src/cli/doctor.rs 68-99
- Environment : Checks for required binaries like sh and git src/cli/doctor.rs 101-106
- Providers : Checks for configured API keys for major providers (Anthropic, OpenAI, etc.) src/cli/doctor.rs 142-172
- Channels : Ensures that at least one communication channel (Telegram, Discord, etc.) is enabled src/cli/doctor.rs 174-222

Title: Diagnostic Execution Flow

```

```

**Sources:** [src/cli/doctor.rs9-49](https://github.com/qhkm/zeptoclaw/blob/2c743d31/src/cli/doctor.rs#L9-L49) [src/cli/doctor.rs108-140](https://github.com/qhkm/zeptoclaw/blob/2c743d31/src/cli/doctor.rs#L108-L140)

## Lifecycle and Maintenance

### Daemon Supervision

The `daemon` command provides a basic supervisor for the ZeptoClaw gateway. It restarts the gateway process if it crashes, implementing an exponential backoff strategy [src/cli/daemon.rs45-80](https://github.com/qhkm/zeptoclaw/blob/2c743d31/src/cli/daemon.rs#L45-L80)

### Self-Update

The `update` command automates the process of staying current:

1. Fetch : Queries GitHub Releases API for the latest tag src/cli/update.rs 65-96
2. Verify : Downloads the binary and its SHA256 checksum, verifying the integrity before installation src/cli/update.rs 128-186
3. Atomic Replace : Replaces the current executable using std::fs::rename and maintains a .old backup for rollback src/cli/update.rs 192-213

### Response Cache

While not a direct command, the system manages an LLM response cache at `~/.zeptoclaw/cache/responses.json`. It uses SHA-256 digests of prompts as keys and implements LRU eviction when the store reaches capacity [src/cache/response_cache.rs3-12](https://github.com/qhkm/zeptoclaw/blob/2c743d31/src/cache/response_cache.rs#L3-L12) [src/cache/response_cache.rs67-76](https://github.com/qhkm/zeptoclaw/blob/2c743d31/src/cache/response_cache.rs#L67-L76)

**Sources:** [src/cli/daemon.rs10-30](https://github.com/qhkm/zeptoclaw/blob/2c743d31/src/cli/daemon.rs#L10-L30) [src/cli/update.rs7-11](https://github.com/qhkm/zeptoclaw/blob/2c743d31/src/cli/update.rs#L7-L11) [src/cache/response_cache.rs43-61](https://github.com/qhkm/zeptoclaw/blob/2c743d31/src/cache/response_cache.rs#L43-L61)
