cipi-sh/api
Laravel/PHP client for the CIPI API, providing a simple way to authenticate and send requests to CIPI services from your applications. Wraps API calls in a clean, consistent interface for easier integration.
Architecture fit
cipi.yml) — plan, apply, and auto-apply. This is a meaningful scope expansion: the package now sits on the path that can mutate production server config, not just read state or trigger deploys.yml-view/yml-manage map to the existing token-ability authorization model, and POST /yml/apply reuses the established async-job pattern (app-yml-apply).GET /yml is synchronous and read-only (safe to poll, safe to surface in dashboards), apply is async, auto/enable|disable is synchronous and idempotent (safe to retry).AppYmlShow, AppYmlApply, AppYmlAuto) means the same capabilities are reachable from agent/tooling surfaces — relevant if we intend to expose server config operations to AI-assisted workflows.Integration feasibility
info.version bumps to 1.35.0 with 4 new paths under a cipi.yml tag plus typed schemas (YmlPlanResponse, YmlAutoResponse, JobResultAppYmlApply). Client stubs/codegen can be regenerated.cipi self-update, migration 5.6.4). This is the gating item for the whole feature set, not a per-endpoint detail.yml-view and yml-manage are not granted to existing tokens. Any pre-existing integration token will 403 on the new routes until a new token is minted via cipi api token create. This is a clean cutover but an unavoidable coordination step./etc/sudoers.d/cipi-api gaining cipi yml plan *, apply *, auto *) are applied by the 5.6.4 migration — worth verifying rather than assuming, since a partially-migrated host is the most likely source of hard-to-diagnose failures.Technical risk
apply returns outcome of applied, unchanged, partial, blocked, invalid, or no-file; the last four terminate the job as failed while still carrying a result payload. Consumers that key off job status alone will discard the diagnostic detail (failures, blockers, errors) needed to explain what happened. This must be encoded in the client, not left to individual call sites.app-yml-apply is asynchronous, so any synchronous "apply and show me" UX needs a job-polling layer with timeout and terminal-state handling.app key the CLI text couldn't supply) alters output shape in some cases — low impact, but it's a behavioral change in a shared result path.Key questions
yml-*) acceptable, or do we force a single cutover?AppYmlApply in particular) exposed to any agent with unattended execution rights? If yes, that needs a separate review.blockers and valid.errors/warnings — pre-apply gate in the UI, or post-hoc reporting?Stack fit
config/cipi.php) for abilities, existing job/polling conventions for app-yml-apply, existing HTTP client for the new routes. No new infrastructure class required.GET /yml showing in_sync, changes, blockers, valid; (b) a gated apply action; (c) an auto-apply toggle with a confirmation step.GET /yml being synchronous and read-only makes it safe to render directly in an admin panel without a queue hop — a genuine simplification versus the deploy endpoints.Migration path
/etc/sudoers.d/cipi-api reflects the three new cipi yml permissions per host; confirm cipi yml plan --json works locally on a representative host.yml-view (read-only consumers) and yml-manage (write consumers) separately — don't bundle manage into tokens that only need to display state.yml-manage; gate auto-apply behind an additional confirmation flow.Compatibility
info.version is now 1.35.0; if we pin generated clients to spec versions, expect a diff limited to the new tag/paths/schemas plus the job-type enum addition.Sequencing
yml-view): plan view, in-sync/blockers/warnings. Low risk, immediate operator value, no server mutation.yml-manage): explicit user action, full result rendering across all six outcome values, job polling with terminal-state handling for the four failure outcomes.AppYmlApply/AppYmlAuto via MCP should require the same authorization gate as the HTTP route.Maintenance
cipi.yml becomes a configuration artifact we now own operationally — schema changes in future Cipi releases will surface as new errors/warnings in yml plan, which is a reasonable early-warning mechanism but also a new class of alert to triage.Support
outcome: invalid (fix the file), blocked (resolve listed blockers), partial (inspect failures/failed), no-file (nothing to apply), unchanged (no-op, not an error), applied (success). Four of these arrive as failed jobs — support scripts must read the result payload, not the job status.yml-* routes should route to "server needs Cipi 5.6.4," not to generic API-outage handling.yml-* routes should route to "token lacks yml-view/yml-manage," which is the expected state for every pre-existing token.Scaling
GET /yml is synchronous; it shells out to cipi yml plan --json per request. If it's used in a list view across many apps, that's N subprocess invocations — plan for caching or on-demand fetch rather than eager per-row loading.apply is async and bounded by the job system; concurrency limits should be set conservatively since applies mutate server state and a blocked/partial outcome may leave a host mid-change.tools/list page is fine today; note the ceiling as the tool count grows.Failure modes
| Failure | Symptom | Handling |
|---|---|---|
| Server < Cipi 5.6.4 | 503 on yml-* only |
Capability-gate the UI; suppress retries |
| Existing token | 403, not 401 | Detect and prompt for token re-issue |
Invalid cipi.yml |
Job failed, outcome: invalid |
Render errors; do not retry |
| Blockers present | Job failed, outcome: blocked |
Render blockers as actionable list |
| Partial apply | Job failed, outcome: partial |
Render applied/failed/failures; escalate |
| Auto-apply + bad commit | Config drift post-deploy, no human in loop | Requires audit log and rollback path before enabling |
| Sudoers not migrated | plan/apply denied at OS level despite valid token |
Verify during 5.6.4 rollout, not at first use |
Ramp-up
How can I help you explore Laravel packages today?