Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.gravixlayer.ai/llms.txt

Use this file to discover all available pages before exploring further.

from gravixlayer import GravixLayer

client = GravixLayer()
runtime = client.runtime.create(template="python-3.14-base-small")

runtime.git.clone(
    url="https://github.com/octocat/Hello-World.git",
    path="/home/user/repo",
)

runtime.file.write("/home/user/repo/note.txt", "hello\n")

# Stage specific paths
r = runtime.git.add("/home/user/repo", paths=["note.txt"])
print(r.success, r.exit_code)

# Omit paths to stage all changes (equivalent to git add -A)
r = runtime.git.add("/home/user/repo")
print(r.success)

runtime.kill()

Parameters

ParameterTypeRequiredDescription
repository_pathstringYesPath to the repository root inside the runtime
pathslist of stringNoPaths relative to the repo root to stage; if omitted, all changes are staged

Response

FieldTypeDescription
successbooleanWhether the git command completed successfully
exit_codeintegerProcess exit code from git
stdoutstringStandard output from git
stderrstringStandard error from git
errorstringError message when the operation fails