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.

import os

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",
)

user, pwd = os.environ.get("GIT_USERNAME"), os.environ.get("GIT_PASSWORD")
if user and pwd:
    r = runtime.git.push(
        "/home/user/repo",
        remote="origin",
        username=user,
        password=pwd,
    )
    print(r.success, r.stderr or r.stdout)

runtime.kill()

Parameters

ParameterTypeRequiredDescription
repository_pathstringYesPath to the repository root inside the runtime
remotestringNoRemote name (for example origin)
refspecstringNoRefspec to push (for example refs/heads/main:refs/heads/main)
usernamestringNoUsername for authenticated push (HTTPS)
passwordstringNoPassword or token for authenticated push (HTTPS)

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