POST /v1/agents/runtime/{runtime_id}/git/status
import uuid
from gravixlayer import GravixLayer
client = GravixLayer() # defaults to cloud="aws", region="us-east-1"
policy = client.network_policies.create(
name=f"git-github-{uuid.uuid4().hex[:8]}",
egress_mode="allowlist",
rules=[{"destination": "github.com", "port": 443, "protocol": "tcp"}],
)
sandbox = client.runtime.create(network_policy_ids=[policy.id]) # defaults to template="base-small"
sandbox.git.clone(
url="https://github.com/octocat/Hello-World.git",
path="/workspace/repo",
)
r = sandbox.git.status("/workspace/repo")
print(r.success, r.stdout)
sandbox.kill()
client.network_policies.delete(policy.id)
import { GravixLayer } from 'gravixlayer';
const client = new GravixLayer(); // defaults to cloud="aws", region="us-east-1"
const policy = await client.networkPolicies.create(`git-github-${Date.now()}`, {
egressMode: 'allowlist',
rules: [{ destination: 'github.com', port: 443, protocol: 'tcp' }],
});
const sandbox = await client.runtime.create({ networkPolicyIds: [policy.id] }); // defaults to template="base-small"
await sandbox.git.clone('https://github.com/octocat/Hello-World.git', '/workspace/repo');
const r = await sandbox.git.status("/workspace/repo");
console.log(r.success, r.stdout);
await sandbox.kill();
await client.networkPolicies.delete(policy.id);
gravixlayer runtime git status "$RT" --path /workspace/repo
curl -X POST "https://api.gravixlayer.ai/v1/agents/runtime/$RT/git/status" \
-H "Authorization: Bearer $GRAVIXLAYER_API_KEY" \
-H "Content-Type: application/json" \
-d '{"repository_path": "/workspace/repo"}'
git status --porcelain, so a clean tree returns an empty stdout
with success: true. Each line is a two-character status code followed by a path.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
repository_path | string | Yes | Path to the repository root inside the runtime |
Response
| Field | Type | Description |
|---|---|---|
success | boolean | Whether the git command completed successfully |
exit_code | integer | Process exit code from git |
stdout | string | Porcelain status text |
stderr | string | Standard error from git |
error | string | Error message when the operation fails |