CLI-Referenz¶
Diese Seite dokumentiert alle verfügbaren Polycrate-CLI-Befehle mit ihren Optionen und Parametern.
Grundlegende Befehle¶
polycrate version¶
Zeigt die aktuelle Version von Polycrate an.
polycrate help¶
Zeigt Hilfe zu Polycrate-Befehlen an.
polycrate update¶
Aktualisiert Polycrate auf die neueste Version.
Parameter: - version (optional) - Spezifische Version, auf die aktualisiert werden soll
Beispiel:
Workspace-Verwaltung¶
polycrate workspace init¶
Initialisiert einen neuen Workspace.
Hinweis: Der Befehl muss im Zielverzeichnis ausgeführt werden. Alternativ kann der Pfad mit --workspace <pfad> übergeben werden.
polycrate workspace¶
Verwaltet den Workspace.
polycrate workspace init¶
Initialisiert einen neuen Workspace (siehe Beispiel oben für das erforderliche Vorgehen im Zielordner).
polycrate workspace inspect¶
Zeigt detaillierte Informationen über den Workspace an.
polycrate workspace snapshot¶
Zeigt den aktuellen Workspace-Snapshot an.
Verwendung:
# Snapshot als YAML ausgeben
polycrate workspace snapshot
# Snapshot in Datei speichern
polycrate workspace snapshot > snapshot.yml
polycrate workspace encrypt¶
Experimental Feature
Workspace-Verschlüsselung ist ein experimentelles Feature und kann sich in zukünftigen Versionen ändern.
Verschlüsselt die Workspace-Konfiguration (workspace.poly) und die Kubeconfig (kubeconfig.yaml).
polycrate workspace decrypt¶
Experimental Feature
Workspace-Verschlüsselung ist ein experimentelles Feature und kann sich in zukünftigen Versionen ändern.
Entschlüsselt die Workspace-Konfiguration und Kubeconfig.
polycrate workspace status¶
Zeigt den Verschlüsselungsstatus des Workspace an.
polycrate workspace update¶
Aktualisiert Workspace-Dependencies.
Block-Verwaltung¶
polycrate block¶
Verwaltet Blocks im Workspace.
polycrate block list¶
Listet alle Blocks im Workspace auf.
Beispiel:
polycrate block init¶
Initialisiert einen neuen Block eines spezifischen Typs.
Optionen: - --kind <kind> - Art des Blocks (z.B. ansible, script)
Beispiel:
polycrate block inspect¶
Zeigt detaillierte Informationen über einen Block an.
Beispiel:
polycrate block pull¶
Lädt einen Block aus der Registry herunter.
Parameter: - block-name - Name des Blocks (kann Registry-URL enthalten) - version (optional) - Version des Blocks (Standard: latest)
Optionen: - --version <version> - Spezifische Version
Beispiele:
# Block vom Standard-Registry pullen
polycrate block pull ayedo/k8s/cluster
# Spezifische Version pullen
polycrate block pull ayedo/k8s/cluster:1.2.0
# Von custom Registry pullen
polycrate block pull index.docker.io/my-org/my-block
polycrate block push¶
Lädt einen Block in die Registry hoch.
Parameter: - block-name - Name des Blocks (kann Registry-URL enthalten)
Hinweis: Beim Pushen eines Blocks wird die Version aus der block.poly automatisch als Tag verwendet. Geben Sie kein Tag im Block-Namen an.
Beispiele:
# Block zum Standard-Registry pushen
polycrate block push ayedo/k8s/cluster
# Zu custom Registry pushen
polycrate block push my.registry.com/my-org/my-block
polycrate block readme¶
Zeigt die README-Datei eines Blocks an.
Beispiel:
polycrate block validate¶
Validiert die Konfiguration eines Blocks.
Beispiel:
Action-Verwaltung¶
polycrate run¶
Führt eine Action oder einen Workflow aus.
Optionen: - -f, --force - Bestätigt alle Prompts automatisch - -l, --local - Führt die Action lokal aus (ohne Container) - -i, --interactive - Macht den Container interaktiv - -b, --build - Baut ein Custom Image aus dem Workspace Dockerfile.poly (Standard: true) - -p, --pull - Pullt das Workspace Image vor der Ausführung (Standard: true) - -e, --env <KEY=value> - Zusätzliche Umgebungsvariablen - -m, --mount <host:container> - Zusätzliche Mounts für den Container - --snapshot - Zeigt nur den Workspace-Snapshot an, führt nichts aus
Beispiele:
# Action ausführen
polycrate run my-block install
# Mit force flag (keine Prompts)
polycrate run my-block install --force
# Lokal ausführen (ohne Container)
polycrate run my-block install --local
# Mit zusätzlichen Umgebungsvariablen
polycrate run my-block deploy -e ENV=prod -e REGION=eu-west-1
# Nur Snapshot anzeigen
polycrate run my-block install --snapshot
polycrate install¶
Führt die install Action eines Blocks aus.
Beispiel:
polycrate uninstall¶
Führt die uninstall Action eines Blocks aus.
Beispiel:
polycrate prune¶
Führt die prune Action eines Blocks aus (typischerweise zum Aufräumen von Artefakten).
Beispiel:
polycrate action¶
Verwaltet Actions.
polycrate action list¶
Listet alle verfügbaren Actions im Workspace auf.
polycrate action inspect¶
Zeigt detaillierte Informationen über eine Action an.
Beispiel:
polycrate action run¶
Führt eine Action aus (identisch mit polycrate run).
Workflow-Verwaltung¶
polycrate workflow¶
Verwaltet Workflows.
polycrate workflow list¶
Listet alle verfügbaren Workflows im Workspace auf.
polycrate workflow inspect¶
Zeigt detaillierte Informationen über einen Workflow an.
Beispiel:
polycrate workflow run¶
Führt einen Workflow aus.
Optionen: Identisch mit polycrate run
Beispiel:
PolyHub-Integration¶
polycrate hub¶
Interagiert mit dem Polycrate Hub.
polycrate hub inspect¶
Zeigt Informationen über einen Block im PolyHub an.
Beispiel:
API-Integration¶
polycrate api¶
Zeigt API-Informationen an.
Optionen: - --api-enabled - Aktiviert API-Integration - --api-url <url> - API-URL (Standard: https://hub.polycrate.io) - --api-api-key <key> - API-Key für Authentifizierung - --api-submit-action-runs - Sendet Action-Ergebnisse an API (Standard: true)
Weitere Befehle¶
polycrate checksum¶
Berechnet die MD5-Checksumme eines Verzeichnisses.
Beispiel:
polycrate completion¶
Generiert Autocompletion-Skripte für verschiedene Shells.
Unterstützte Shells: - bash - zsh - fish - powershell
Beispiele:
# Bash
polycrate completion bash > /etc/bash_completion.d/polycrate
# Zsh
polycrate completion zsh > ~/.zsh/completion/_polycrate
# Fish
polycrate completion fish > ~/.config/fish/completions/polycrate.fish
Globale Flags¶
Diese Flags können mit jedem Befehl verwendet werden:
Workspace-Konfiguration¶
-w, --workspace <path>- Pfad zum Workspace (Standard:$PWD)--workspace-config <file>- Name der Workspace-Config-Datei (Standard:workspace.poly)--workspace-dir <path>- Pfad zum Workspaces-Verzeichnis (Standard:~/.polycrate/workspaces)
Block-Konfiguration¶
--blocks-root <path>- Blocks-Root-Verzeichnis (Standard:blocks)--blocks-config <file>- Name der Block-Config-Datei (Standard:block.poly)--blocks-auto-pull- Automatisches Pullen fehlender Blocks (Standard: false)
Container-Konfiguration¶
--image-ref <ref>- Workspace-Image-Referenz (Standard:cargo.ayedo.cloud/library/polycrate)--image-version <version>- Workspace-Image-Version (Standard:latest)--dockerfile <file>- Workspace-Dockerfile (Standard:Dockerfile.poly)--container-root <path>- Container-Root-Verzeichnis (Standard:/workspace)
Artefakte und Logs¶
--artifacts-root <path>- Artefakte-Root-Verzeichnis (Standard:artifacts)--logs-root <path>- Logs-Root-Verzeichnis (Standard:.logs). Nur relevant wenn Transaction-Logging aktiviert oder Event-Handler konfiguriert ist.--workflows-root <path>- Workflows-Root-Verzeichnis (Standard:workflows)
SSH-Konfiguration¶
--ssh-private-key <file>- SSH-Private-Key (Standard:id_rsa)--ssh-public-key <file>- SSH-Public-Key (Standard:id_rsa.pub)--ssh-use-passphrase- Aktiviert SSH-Key-Passphrase-Support ⚠️ Experimental
Registry-Konfiguration¶
--registry-url <url>- URL der OCI-Registry (Standard:cargo.ayedo.cloud)--registry-base-image <image>- Base-Image für Block-Packaging (Standard:cargo.ayedo.cloud/library/scratch:latest)
PolyHub-Konfiguration¶
--hub-url <url>- URL des PolyHub (Standard:https://hub.polycrate.io)--hub-username <username>- PolyHub-Benutzername--hub-password <password>- PolyHub-Passwort--hub-api-key <key>- PolyHub-API-Key
Entwicklung und Debugging¶
--dev- Entwicklungsmodus für Blocks--loglevel <level>- Log-Level (Standard: 1)--logformat <format>- Log-Format (json/yaml/default)--merge-debug- Merge-Debugging aktivieren--merge-v2- Merge v2 verwenden--validate-block-config- Block-Konfiguration validieren
Weitere Flags¶
-o, --output-format <format>- Output-Format (Standard: yaml)--auto-commit- Automatisches Commit des Workspace vor/nach Action-Ausführung--check-updates- Prüft beim Start auf Updates--config-dir <path>- Pfad zum Config-Verzeichnis (Standard:~/.polycrate)--config-file <path>- Pfad zur Config-Datei (Standard:~/.polycrate/polycrate.yml)--editor <editor>- Editor zum Öffnen des Workspace (Standard:code)--kubeconfig <path>- Pfad zur globalen Kubeconfig (Standard:~/.kube/config)--remote-root <path>- Remote-Root für Remote-Hosts (Standard:/polycrate)--runtime-dir <path>- Pfad zum Runtime-Verzeichnis (Standard:~/.polycrate/run)
Event-Konfiguration¶
--event-commit- Auto-Commit für jedes Event--event-endpoint <url>- Standard-Event-Endpoint--event-handler <handler>- Standard-Event-Handler