Zum Inhalt

CLI Referenz (ccs)

Die ccs CLI ist die Rust-basierte Kommandozeilen-Schnittstelle für CC-Sprint. Sie nutzt dieselben Funktionen wie die Desktop-App.

Single Point of Implementation

APP und CLI nutzen identischen Rust-Code. Änderungen müssen nur an einer Stelle gemacht werden.

Installation

# Binary befindet sich in:
src-tauri/target/release/ccs.exe  # Windows
src-tauri/target/release/ccs      # Linux/macOS

# Optional: Zum PATH hinzufügen

Befehle

Timestamp

Holt aktuelle Zeit in verschiedenen Formaten.

# Backlog.md Format (default)
ccs timestamp --format backlog
# Output: 2026-02-04 19:08

# ISO 8601
ccs timestamp --format iso
# Output: 2026-02-04T19:08:20+01:00

# Unix Timestamp
ccs timestamp --format unix
# Output: 1770228500

# Full Format
ccs timestamp --format full
# Output: 2026-02-04 19:08:20

Use Case: Timestamp für Backlog.md Header.


Backlog

Backlog.md Operationen.

Validate

Validiert Backlog.md Format.

ccs backlog validate --project .

Output (JSON):

{
  "valid": true,
  "item_count": 100,
  "errors": []
}

Edit

Sicheres Bearbeiten mit Backup.

# Insert before section
ccs backlog edit --project . --file new_item.md --insert-before "## Technical Tasks"

# Insert after item
ccs backlog edit --project . --file new_item.md --insert-after "### [F-0049]"

# Complete rewrite (gefährlich!)
ccs backlog edit --project . --file complete_backlog.md --write

Output (JSON):

{
  "success": true,
  "hash": "abc123...",
  "itemCount": 101,
  "message": "Inserted before '## Technical Tasks'"
}

Features:

  • ✅ Automatisches Backup vor Änderung
  • ✅ Format-Validierung
  • ✅ Auto-Cleanup (Duplikate, Leerzeilen)
  • ✅ Triggert File-Watcher in App

Path

Zeigt Pfad zur Backlog.md.

ccs backlog path --project .
# Output: ./docs/Backlog.md

Git

Git-Operationen.

Status

ccs git status --project .

Output (JSON):

{
  "is_repo": true,
  "branch": "dev",
  "remote_url": "https://gitlab.example.com/user/repo.git",
  "has_uncommitted_changes": true,
  "has_unpushed_commits": false
}

Commit

ccs git commit --project . \
  --files docs/Backlog.md CLAUDE.md \
  --message "Update backlog" \
  --push

Output (JSON):

{
  "committed": true,
  "pushed": true,
  "commit_hash": "abc123",
  "message": "Committed 2 files"
}


Backup

Backup-Management.

List

ccs backup list --project .

Output (JSON):

[
  {
    "filename": "backlog-2026-02-04_19-08-00.md",
    "timestamp": "2026-02-04T19:08:00",
    "size_bytes": 156000,
    "item_count": 100
  }
]

Create

ccs backup create --project .

Output (JSON):

{
  "success": true,
  "backup_path": ".backlog-admin/backups/backlog-2026-02-04_19-10-00.md"
}

Restore

ccs backup restore --project . backlog-2026-02-04_19-08-00.md

Validate

ccs backup validate --project . backlog-2026-02-04_19-08-00.md

Output (JSON):

{
  "valid": true,
  "item_count": 100,
  "errors": [],
  "warnings": []
}


Output-Format

Alle Outputs sind JSON - einfach zu parsen für Claude Code und Skripte.

# Beispiel: Item-Count extrahieren
ccs backlog validate --project . | jq '.item_count'
# Output: 100

# Beispiel: Prüfen ob valid
ccs backlog validate --project . | jq '.valid'
# Output: true

Exit Codes

Code Bedeutung
0 Erfolg
1 Allgemeiner Fehler
2 Ungültige Argumente
3 Datei nicht gefunden
4 Validierungsfehler

Beispiel-Workflows

Neues Item hinzufügen

# 1. Item-Datei erstellen
cat > /tmp/new_item.md << 'EOF'
### [F-0051] Neues Feature
- **Status**: Offen
- **Priorität**: Mittel
- **Phase**: Idee
- **Bereich**: funktional
- **Beschreibung**:
  Beschreibung des Features...
EOF

# 2. Item einfügen
ccs backlog edit --project . --file /tmp/new_item.md --insert-before "## Technical Tasks"

# 3. Commit & Push
ccs git commit --project . --files docs/Backlog.md --message "Add F-0051" --push

Backlog validieren

# Validieren und Fehler anzeigen
result=$(ccs backlog validate --project .)
if [ "$(echo $result | jq '.valid')" = "false" ]; then
  echo "Validation errors:"
  echo $result | jq '.errors[]'
  exit 1
fi
echo "Backlog is valid with $(echo $result | jq '.item_count') items"

Backup vor großer Änderung

# 1. Backup erstellen
ccs backup create --project .

# 2. Änderungen machen
# ...

# 3. Bei Fehler: Restore
ccs backup restore --project . backlog-2026-02-04_19-08-00.md

Deprecated: Python Scripts

Deprecated

Die Python-Skripte in scripts/ sind deprecated und werden nicht mehr gepflegt.

Verwende stattdessen die ccs CLI!

Altes Script Neuer CLI-Befehl
python scripts/get_time.py ccs timestamp --format backlog
python scripts/safe_backlog_edit.py ccs backlog edit --project .
python scripts/fix_backlog_indentation.py Nicht mehr nötig (Auto-Cleanup)

Siehe auch


Letzte Aktualisierung: 2026-02-04