Skip to content

Add capfox run wrapper command - #1

Merged
haskel merged 1 commit into
mainfrom
feature/run-command
Feb 20, 2026
Merged

Add capfox run wrapper command#1
haskel merged 1 commit into
mainfrom
feature/run-command

Conversation

@haskel

@haskel haskel commented Feb 20, 2026

Copy link
Copy Markdown
Owner

Summary

  • Implements capfox run wrapper command that checks server capacity before executing any command
  • Works like time or nice - wrap any command with capfox run to check capacity first
  • Supports all the same flags as capfox ask: --task, --complexity, --cpu, --mem, --gpu, --vram
  • Updates version to 0.2.0

Features

  • Exit codes:

    • 0-125: Command's exit code (passthrough)
    • 75: No capacity available (EX_TEMPFAIL from sysexits.h)
    • 126: Command not executable
    • 127: Command not found
  • Fail-open behavior: If server is unreachable, command still executes

  • Quiet mode: --quiet flag suppresses capfox output

  • Reason display: --reason flag shows denial reasons

Usage

# Basic usage
capfox run ./script.sh

# With task name and complexity
capfox run --task ml_training --complexity 100 python train.py

# With resource estimates
capfox run --cpu 50 --mem 30 ./heavy.sh

# Quiet mode
capfox run --quiet ./script.sh

Test plan

  • Unit tests for command structure and flags
  • Tests for exit code handling
  • Tests for task name derivation
  • All existing tests pass

Implements a wrapper command that checks server capacity before
executing any command. Works like 'time' or 'nice' - wrap any
command with 'capfox run' to check capacity first.

Features:
- Wraps any command and checks capacity via /ask endpoint
- Supports --task, --complexity, --cpu, --mem, --gpu, --vram flags
- Exit code 75 (EX_TEMPFAIL) when no capacity available
- Passthrough of stdin/stdout/stderr
- Fail-open behavior when server unreachable

Exit codes:
- 0-125: Command's exit code
- 75: No capacity (EX_TEMPFAIL)
- 126: Command not executable
- 127: Command not found

Also updates version to 0.2.0
@haskel
haskel merged commit 9921f49 into main Feb 20, 2026
2 checks passed
@haskel
haskel deleted the feature/run-command branch February 20, 2026 03:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant