Skip to main content

A command-line interface for Argo Workflows

Project description

Argo CLI

A command-line interface for interacting with Argo.

This project uses UV for dependency management.

Installation

pip install argocli

Authentication

On first-run, you'll be prompted for an Argo API token. This will be stored in your system credential store (e.g. Keychain on Mac OS) in an item called argocli.

Configuration

On first-run, a configuration file will be generated at ~/.config/argocli/config.yaml. In this file you'll need to replace the values of server, namespace, and username with appropriate values.

server: https://your-argo-instance.server.tld
namespace: YOUR_PROJECT_NAMESPACE
username: your.email@example.com

Environment Variables

You can also override configuration values using environment variables. The naming pattern is:

ARGOCLI_<UPPERCASE_CONFIG_KEY>

For example:

  • ARGOCLI_SERVER overrides the server config option
  • ARGOCLI_NAMESPACE overrides the namespace config option
  • ARGOCLI_USERNAME overrides the username config option

This is useful for CI/CD pipelines or for switching between different Argo instances without modifying the config file.

Usage

The Argo CLI follows a command-action pattern for all operations:

argocli <command> <action> [options]

Available Commands

Command Action Description
workflow status Show the status of a specific workflow
workflow list List all workflows with optional name filtering
workflow view View detailed information about a specific workflow

Global Options

  • --verbose: Enable debug output
  • --output [table|json]: Control output format (default: table)
  • --help: Show command help

Examples

Workflow Commands

Show the status of a workflow:

argocli workflow status -n WORKFLOW_NAME

List all workflows:

argocli workflow list

Filter workflows by name (fuzzy match):

argocli workflow list -n cron

List workflows with JSON output:

argocli workflow list --output json

View detailed information about a specific workflow:

argocli workflow view -n WORKFLOW_NAME

View workflow information in JSON format (this will dump the entire workflow object, which is useful for further API work):

argocli workflow view -n WORKFLOW_NAME --output json

Development

Setup Development Environment

# Install dependencies including dev dependencies
uv sync

# Activate the venv
source .venv/bin/activate

# Run tests
uv run pytest

# Run tests with coverage report
uv run pytest --cov=argocli --cov-report=term

Testing

The project uses pytest for unit testing. Tests are organized in a structure that mirrors the main codebase:

  • tests/unit/ - Unit tests
    • commands/ - Tests for command implementations
      • workflow/ - Tests for workflow-related commands
    • core/ - Tests for core functionality

To run specific tests:

# Run tests in a specific file
pytest tests/unit/core/test_client.py

# Run a specific test class
pytest tests/unit/commands/workflow/test_list.py::TestWorkflowList

# Run a specific test method
pytest tests/unit/commands/workflow/test_list.py::TestWorkflowList::test_execute_filtered_list

Project Structure

  • argocli/commands/ - Command implementations
    • workflow/ - Workflow-related commands
  • argocli/cli/ - CLI entry point and argument parsing
  • tests/ - Test directory

Adding New Commands

  1. Create a new action module in the appropriate command directory.
  2. Define a class that inherits from the command's base class.
  3. Implement define_arguments() and execute() methods.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

argocli-0.3.0.tar.gz (12.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

argocli-0.3.0-py3-none-any.whl (14.2 kB view details)

Uploaded Python 3

File details

Details for the file argocli-0.3.0.tar.gz.

File metadata

  • Download URL: argocli-0.3.0.tar.gz
  • Upload date:
  • Size: 12.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for argocli-0.3.0.tar.gz
Algorithm Hash digest
SHA256 7e95749c279f996f9e1204a975857de8fd8f39644e289b00de4536a97ebdb231
MD5 a1ab25018dc2d72e8c3f4fac4f70371d
BLAKE2b-256 20e66a7be401db203afda21e6230f56156af67d69ce94993fda61528ce2959de

See more details on using hashes here.

Provenance

The following attestation bundles were made for argocli-0.3.0.tar.gz:

Publisher: create_artifacts_and_publish.yaml on rpunt/argocli

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file argocli-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: argocli-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 14.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for argocli-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 81975f72c572a9a6e6d2217f5d8599c3504570a7facb13d11a61878ff3e48a3c
MD5 84e0188a769b2b8ef56d22b91ecec082
BLAKE2b-256 b03ef0a3706c1fe651ac22da0e9b97aff96fafdfbd6d80ace9e2bbd1d7f92e85

See more details on using hashes here.

Provenance

The following attestation bundles were made for argocli-0.3.0-py3-none-any.whl:

Publisher: create_artifacts_and_publish.yaml on rpunt/argocli

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page