Skip to main content

Client library for nightshift autonomous coding agent

Project description

nightshift-client

nightshift-client is the client-side Python package for the Nightshift tracker.

Installation

cd nightshift-client
pip install -e .

Python API

from nightshift_client import NightshiftClient

client = NightshiftClient(repo_path=".", identity="user@example.com")

Issue Creation

issue_id = client.create_issue("Fix the bug", "Detailed description here")
client.push()

Monitoring State

state = client.check_state(issue_id)
# Returns: "open", "working", "waiting:question", "waiting:review", 
#          "waiting:human-review", "suspended:*", "closed", etc.

Q&A Flow

question = client.get_pending_question(issue_id)
if question:
    client.post_answer(issue_id, "The answer is 42")
    client.push()

Remote Commands

Trigger orchestration commands on the nightshift host via tracker comments. These post @nightshift <command> comments that the watcher scans and executes.

# Accept completed work (merge agent branch to master)
client.accept(issue_id)

# Reject work (discard agent branch)
client.reject(issue_id)

# Request revisions with feedback
client.revise(issue_id, "Please add error handling for the edge case")

# Resume a suspended session
client.resume(issue_id)
client.resume(issue_id, prompt="Continue from where you left off")

Protocol: Each method posts a comment (e.g., @nightshift accept) and pushes. The watcher scans for these comments during sync and executes the corresponding CLI command. Result comments (✓ Accepted or ✗ Failed: ...) are posted back.

Sync

client.push()  # Push local changes to remote
client.pull()  # Pull remote changes

CLI usage

nightshift-client daemon status --repo .
nightshift-client daemon start --repo .
nightshift-client daemon stop --repo .

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nightshift_client-0.1.6.tar.gz (21.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nightshift_client-0.1.6-py3-none-any.whl (16.7 kB view details)

Uploaded Python 3

File details

Details for the file nightshift_client-0.1.6.tar.gz.

File metadata

  • Download URL: nightshift_client-0.1.6.tar.gz
  • Upload date:
  • Size: 21.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for nightshift_client-0.1.6.tar.gz
Algorithm Hash digest
SHA256 8cb57e10136d3b1e07214b8e0a34aa167184596491825dca64d6f5d9e0602642
MD5 22daa142ef20e7190a3309774079cc40
BLAKE2b-256 f3976562842904d6fc15d72c16c304597c2d4fb3596ea43be3e015ca75d13f18

See more details on using hashes here.

File details

Details for the file nightshift_client-0.1.6-py3-none-any.whl.

File metadata

File hashes

Hashes for nightshift_client-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 3ed59969238a9784061ad8c35fd431b9b93ca7a92bd4d90863ef5733e6cb0775
MD5 e4ec44c84f4a46196db08bbc2b78c2fa
BLAKE2b-256 1c4e148d4fa1ef3a7bb7a5700095d6b8ddac07bac77e939a8a094d58f74bdb8d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page