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.7.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.7-py3-none-any.whl (16.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: nightshift_client-0.1.7.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.7.tar.gz
Algorithm Hash digest
SHA256 42b6c195d4d4f8f7b455e97d04aa9fe2821fea9ef1cfc96afe5ffb3f21997ad5
MD5 5dbd99650babaa6a03a072445f332812
BLAKE2b-256 dafa66afda093d9e3af6786f72eec618bdd66d5e6619dbc2d976e78447aebf36

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nightshift_client-0.1.7-py3-none-any.whl
Algorithm Hash digest
SHA256 9fac06f92abff9609d4cf3ecfa90ecae0e743249dbaf5035072e1b88ce90a7a6
MD5 8c33cfa8b3db440ed0eeef19d343bbbe
BLAKE2b-256 c2f6661d8bad21de0c9c9582d6d580e3c80f3d6dd70226625e4fafbb896633ce

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