Generate project tech documentation and push to Confluence using GitHub Copilot SDK
Project description
tsu-cli
Generate project documentation using GitHub Copilot SDK and integrate with document storage tools like Confluence.
⚠️ AI Usage Disclosure
This project was developed with the assistance of Artificial Intelligence (AI) tools, including [e.g., Claude/Copilot]. While I have reviewed, verified and tested the code, portions of the codebase were generated automatically.
- Human Review: The code has been reviewed by me for accuracy, but potential bugs or edge cases may exist.
- Best Practice: Users are encouraged to carefully inspect code before using it in production environments.
Prerequisites
- Python 3.11+
- GitHub Copilot CLI — installed and authenticated (installation guide)
- Confluence API token — for pushing pages (create one here)
Installation
pip install tsu-cli
Development install
git clone https://github.com/vivekrana2012/tsu-cli.git
cd tsu-cli
pip install -e ".[dev]"
Quick Start
# 1. Initialize in your project directory
cd /path/to/your/project
tsu init
# 2. Generate tech documentation
tsu generate
# 3. Push to Confluence
tsu push
What happens during setup
tsu initcreates a.tsu/directory with configuration and a prompt template.- If you provide a Confluence parent page URL and credentials, a blank placeholder
page is created immediately — locking the
page_idso future pushes (including CI/CD) update the same page instead of creating duplicates. tsu generatesends your codebase to a Copilot-powered LLM and writes.tsu/document.md. If a Confluence page already exists, its content is pulled first so manual edits are preserved.tsu pushconverts the markdown to Confluence storage format and uploads it.
Commands
tsu init
Interactive setup — creates .tsu/ directory with configuration files.
If you provide a parent page URL and credentials, a blank placeholder page is
created on Confluence during init. The page_id is saved in
.tsu/confluence.json so that all future tsu push runs (including from
CI/CD pipelines like Jenkins) update the same page instead of creating
duplicates. Re-running tsu init preserves the existing page_id.
tsu init
tsu init --dir /path/to/project
tsu init --profile func # initialize a custom profile
| Flag | Description | Default |
|---|---|---|
-d, --dir |
Project directory | current directory |
-p, --profile |
Profile name | tech |
tsu generate
Analyze the project using GitHub Copilot and generate .tsu/document.md.
If a Confluence page already exists, the current page content is pulled and sent to the LLM as reference — preserving any manually added content while updating sections based on the latest codebase.
tsu generate
tsu generate --model claude-sonnet-4.5
tsu generate --output custom-doc.md
tsu generate --extra "Focus on the authentication flow"
tsu generate --offline # skip Confluence sync, generate fresh
tsu generate --profile func # generate for a specific profile
| Flag | Description | Default |
|---|---|---|
-d, --dir |
Project directory | current directory |
-m, --model |
LLM model name (auto uses SDK default) |
value in config.json |
-o, --output |
Output file path | .tsu/document.md |
-e, --extra |
One-off instructions appended to the prompt | — |
-p, --profile |
Profile name | tech |
--offline |
Skip Confluence sync, generate fresh from codebase only | off |
tsu push
Upload .tsu/document.md to Confluence. Creates a new page on first push,
updates the existing page on subsequent pushes (version is incremented
automatically).
tsu push
tsu push --profile func
| Flag | Description | Default |
|---|---|---|
-d, --dir |
Project directory | current directory |
-p, --profile |
Profile name | tech |
tsu pull
Fetch the remote Confluence page as markdown and save it locally. Requires a
page_id in the profile's Confluence config.
tsu pull
tsu pull --profile func
| Flag | Description | Default |
|---|---|---|
-d, --dir |
Project directory | current directory |
-p, --profile |
Profile name | tech |
tsu list-profiles
Show all initialized profiles with their prompt file, Confluence page title, and page ID.
tsu list-profiles
tsu list-profiles --dir /path/to/project
tsu models
List available LLM models from the Copilot SDK.
tsu models
tsu help
Show a detailed guide covering the full workflow, all commands, flags, authentication, prompt customization, and examples.
tsu help
tsu auth
Manage Confluence credentials (stored in system keychain, never on disk).
tsu auth set # Store email + token in keychain
tsu auth status # Check credential configuration
tsu auth clear # Remove stored credentials
tsu --version
Print the installed version.
tsu --version
tsu -v
Profiles
Profiles let you maintain multiple independent documents from the same project — for example a tech overview, a functional spec, and an API reference — each with its own prompt template, Confluence page, and output file.
The default profile is tech. Create additional profiles by passing
--profile <name> to init, generate, push, or pull.
Creating and using profiles
# Initialize profiles
tsu init # creates the default "tech" profile
tsu init --profile func # creates a "func" profile
tsu init --profile api # creates an "api" profile
# Generate & push per profile
tsu generate --profile func
tsu push --profile api
# See all profiles
tsu list-profiles
Per-profile files
Each profile gets its own set of files inside .tsu/:
| File type | tech (default) |
Custom profile {name} |
|---|---|---|
| Confluence config | confluence.json |
confluence-{name}.json |
| Prompt template | generate.md |
generate-{name}.md |
| Generated output | document.md |
document-{name}.md |
config.json (model selection) is shared across all profiles.
Re-running tsu init for an existing profile preserves the page_id and
will not overwrite an edited prompt template.
Configuration
All config lives in .tsu/ (safe to commit — no secrets):
| File | Purpose |
|---|---|
config.json |
Shared tool settings (LLM model) |
confluence.json |
Confluence page target (per profile) |
generate.md |
Prompt template (per profile, editable) |
document.md |
Generated documentation (per profile) |
Confluence Credentials
Credentials are resolved in this order (never stored in config files):
- Environment variables:
CONFLUENCE_USER,CONFLUENCE_TOKEN - System keychain (via
tsu auth set) - Interactive prompt
Use environment variables for CI/CD pipelines.
Customizing the Prompt
tsu init copies the default prompt template to .tsu/generate.md (or
.tsu/generate-{profile}.md for custom profiles). Edit it freely — your
changes are used on every subsequent tsu generate run, and re-running
tsu init will not overwrite an existing template.
Default sections
The template ships with six sections. You can add, remove, reorder, or rewrite any of them:
| # | Section | Format |
|---|---|---|
| 1 | Overview | 2-4 paragraphs — what the project does, language, framework |
| 2 | Tech Stack & Frameworks | Table: Category · Technology · Version · Notes |
| 3 | Architecture | Prose + ASCII/Unicode architecture diagram + flow diagram + component responsibilities table |
| 4 | API Endpoints | Table: Method · Path · Description (skipped if none found) |
| 5 | Configuration | Table per config source: Key · Type · Default · Required · Description |
| 6 | Dependencies Summary | Table: Dependency · Version · Purpose |
How to customize
- Add a section — append a new
## 7. Securityheading with instructions. - Remove a section — delete the heading and its instructions from the file.
- Change detail level — rewrite the instructions under a heading (e.g. "Write a single paragraph" instead of "Use a table").
- One-off tweaks — use
--extrawithout editing the template:tsu generate --extra "Focus on the authentication flow" tsu generate --extra "Write in Japanese" tsu generate --extra "Skip the dependencies section"
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file tsu_cli-0.1.9.tar.gz.
File metadata
- Download URL: tsu_cli-0.1.9.tar.gz
- Upload date:
- Size: 43.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a8d2b8ed03307abeb430ffac75146fbb819ef441b60c1b69dbb8e6d1d8e09c01
|
|
| MD5 |
fa78505032338b8e46d46f714f958737
|
|
| BLAKE2b-256 |
c0b3c18854c0ccd4e3e3f225acd9d314df1899caa4ea9861fcceefaa15be36fe
|
File details
Details for the file tsu_cli-0.1.9-py3-none-any.whl.
File metadata
- Download URL: tsu_cli-0.1.9-py3-none-any.whl
- Upload date:
- Size: 30.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
46a0e2df0030f524160aff513499635c2b1e7edd19be15291a208c59b189997e
|
|
| MD5 |
9882965c5aa98bd526766334c7b7feb9
|
|
| BLAKE2b-256 |
b589e24dc50ef00db845c2d637caae3e1b8c08b578ec9a00dd5c46fb3ed9eeda
|