Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
8dd513d
feat!: add ci cd with last version
Tadomika-Ari Jun 30, 2026
2fe6a29
docs: add new description for the cli project
Tadomika-Ari Jun 30, 2026
d9bbef4
feat!: add file for dev on nixos
Tadomika-Ari Jun 30, 2026
e71313c
feat!: add gitignore
Tadomika-Ari Jun 30, 2026
256f12a
feat!: add requirement for this project
Tadomika-Ari Jun 30, 2026
c93069f
feat!: add first file
Tadomika-Ari Jun 30, 2026
e05b478
docs: add feature template
Tadomika-Ari Jun 30, 2026
56d8efa
docs: add release template
Tadomika-Ari Jun 30, 2026
20bce64
docs: rm line not use for this project
Tadomika-Ari Jun 30, 2026
293b6b9
feat!: add more gitgnore
Tadomika-Ari Jul 2, 2026
18bad4d
feat!: add commit policy documentation
Tadomika-Ari Jul 2, 2026
468967c
feat!: add rich librrary
Tadomika-Ari Jul 2, 2026
972a431
feat!: add first command help
Tadomika-Ari Jul 2, 2026
b6e37ba
feat!: add text for help command
Tadomika-Ari Jul 2, 2026
81209c9
feat!: add rich intro
Tadomika-Ari Jul 2, 2026
223d719
docs: add docs for command
Tadomika-Ari Jul 2, 2026
197290c
feat!: add dotenv on the requirement
Tadomika-Ari Jul 2, 2026
87ff0d8
feat!: add all important files in gitignore
Tadomika-Ari Jul 2, 2026
02a44d8
feat!: add music section command
Tadomika-Ari Jul 2, 2026
cb3bf34
feat!: add get device id
Tadomika-Ari Jul 2, 2026
9b0b616
feat!: add get token for identification
Tadomika-Ari Jul 2, 2026
0370d71
feat!: add music section
Tadomika-Ari Jul 2, 2026
4f8310d
feat!: add resume
Tadomika-Ari Jul 2, 2026
2cc6cd7
feat!: add pause
Tadomika-Ari Jul 2, 2026
5a0822a
feat!: add light control with command
Tadomika-Ari Jul 2, 2026
052bf97
docs: fix wrong name of this project
Tadomika-Ari Jul 2, 2026
e52cb50
fix: rename file for real name
Tadomika-Ari Jul 2, 2026
29b86c7
docs: fix description with good name of this project
Tadomika-Ari Jul 2, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE/feature.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Feature: `<short description>`

## Summary
> What this PR adds and why.

## Related Issue
Closes #

## Changes
### What's new
-

### Implementation notes
> Key design decisions, tradeoffs, or anything a reviewer should know before reading the diff.
-

## Checklist
- [ ] Conventional Commits used for all commits
- [ ] Tests added/updated for new behavior
- [ ] Docs/README updated if public API changed
- [ ] No unrelated changes bundled in this PR

## Out of Scope
> Anything deliberately left out (tracked in a separate issue, if applicable).
-

## Links
- Issue: #
- Docs:
33 changes: 33 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE/release.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Release `vX.Y.Z`

## Summary

> What changed and why.

## Changes

### New features
-

### Bug fixes
-

### Breaking changes
-

## Checklist

- [ ] Conventional Commits verified on `main`
- [ ] `release-config.json` / `.release-manifest.json` up to date
- [ ] Tests passing on mGBA
- [ ] `pipx run build` clean locally
- [ ] **Cartridge App** workflow green on `stable`

## Rollback

> If broken post-merge: publish a patch `vX.Y.Z+1` and yank on PyPI.

## Links

- Issue: #
- Docs:
48 changes: 48 additions & 0 deletions .github/policy_commit.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Policy de commit

## Format

```
<type>(<scope>): <description>
```

- **type** : obligatoire, voir liste ci-dessous
- **scope** : optionnel, module/partie concernée (ex: `cli`, `ci`, `bot`)
- **description** : à l'impératif, minuscule, pas de point final

## Types

- `feat!` : nouvelle fonctionnalité
- `fix` : correction de bug
- `refactor` : changement de code sans impact fonctionnel
- `docs` : documentation uniquement
- `test` : ajout/modif de tests
- `ci` : pipeline CI/CD

## Règles

1. Une ligne de résumé (72 caractères max)
2. Un commit = un changement logique
3. Description claire, pas de "fix stuff" ou "update"
4. Corps du message (optionnel) séparé par une ligne vide, explique le *pourquoi*
5. Pas d'emoji, pas de ponctuation superflue

## Exemples

```
feat(cli): add boot animation with rich progress bar
fix(ci): correct rsync path in sync workflow
refactor(bot): extract command handlers into separate module
docs: add setup instructions for devenv
chore: bump python dependencies
```

## Breaking changes

Ajouter `!` après le type/scope et expliquer dans le corps :

```
feat!: change config format from json to toml

Migration nécessaire, voir CHANGELOG.md
```
3 changes: 1 addition & 2 deletions .github/workflows/LaMira.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ env:
jobs:
check_work:
runs-on: ubuntu-latest
if: github.repository != 'Project-Tranquility/cli'
name: check_work
container:
image: python:3.14
Expand All @@ -30,7 +29,7 @@ jobs:
mira:
runs-on: ubuntu-latest
needs: check_work
if: github.repository != 'Project-Tranquility/Tranquillity' && github.repository != 'Project-Tranquility/cli' && github.event_name == 'push' && github.ref == 'refs/heads/main' && needs.check_work.result == 'success'
if: github.repository != 'Project-Tranquility/Tranquillity' && github.event_name == 'push' && github.ref == 'refs/heads/main' && needs.check_work.result == 'success'
steps:
- uses: actions/checkout@v6
with:
Expand Down
16 changes: 16 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Devenv
.devenv*
devenv.local.nix
devenv.local.yaml

# direnv
.direnv

# pre-commit
.pre-commit-config.yaml
.vscode

__pycache__
.env

.spotify_token.json
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
# cli
cli for Tranquility
# ctOS
ctOS ?
This is Central Tranquillity Operating System, the cli for Tranquillity
26 changes: 26 additions & 0 deletions ctOS.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
from test import demo
from src.start.start import start
from src.help import help
import sys
from dotenv import load_dotenv
from src.music.music import music_command

load_dotenv()

def main():
nb = len(sys.argv)

if nb <= 1:
help()
return
if sys.argv[1] == "--music":
music_command()
return
if sys.argv[1] == "--help" or "-h":
help()
if sys.argv[1] == "hello":
demo()
start()
else:
return 84
main()
65 changes: 65 additions & 0 deletions devenv.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
{
"nodes": {
"devenv": {
"locked": {
"dir": "src/modules",
"lastModified": 1782751734,
"narHash": "sha256-shLdS1fYdEQvbp+XzzSDq/pBxKoniU+cqXvDFgmEE70=",
"owner": "cachix",
"repo": "devenv",
"rev": "26c8d030f9398fb8531a2b19f6b3aaa8b3589b47",
"type": "github"
},
"original": {
"dir": "src/modules",
"owner": "cachix",
"repo": "devenv",
"type": "github"
}
},
"nixpkgs": {
"inputs": {
"nixpkgs-src": "nixpkgs-src"
},
"locked": {
"lastModified": 1782132010,
"narHash": "sha256-ZnAVHdVrotp80iIMm5CSR1fdxPlw7Uwmwxb+O/wsgZ8=",
"owner": "cachix",
"repo": "devenv-nixpkgs",
"rev": "12866ae2dddbc0ab8b329915f8072bb9c75bde89",
"type": "github"
},
"original": {
"owner": "cachix",
"ref": "rolling",
"repo": "devenv-nixpkgs",
"type": "github"
}
},
"nixpkgs-src": {
"flake": false,
"locked": {
"lastModified": 1781607440,
"narHash": "sha256-rxO+uc/KFbSJp+pgyXRuAX6QlG9hJdnt0BXpEQRXY+U=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "3e41b24abd260e8f71dbe2f5737d24122f972158",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"devenv": "devenv",
"nixpkgs": "nixpkgs"
}
}
},
"root": "root",
"version": 7
}
52 changes: 52 additions & 0 deletions devenv.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
{ pkgs, lib, config, inputs, ... }:

{
# https://devenv.sh/basics/
env.GREET = "devenv";

# https://devenv.sh/packages/
packages = [ pkgs.git ];

# https://devenv.sh/languages/
# languages.rust.enable = true;

# https://devenv.sh/processes/
# processes.dev.exec = "${lib.getExe pkgs.watchexec} -n -- ls -la";

# https://devenv.sh/services/
# services.postgres.enable = true;

# https://devenv.sh/scripts/
scripts.hello.exec = ''
echo hello from $GREET
'';

# https://devenv.sh/basics/
enterShell = ''
hello # Run scripts directly
git --version # Use packages
'';

# https://devenv.sh/tasks/
# tasks = {
# "myproj:setup".exec = "mytool build";
# "devenv:enterShell".after = [ "myproj:setup" ];
# };

languages.python = {
enable = true;
venv.enable = true;
venv.requirements = ./requirement.txt;
};

# https://devenv.sh/tests/
enterTest = ''
echo "Running tests"
git --version | grep --color=auto "${pkgs.git.version}"
'';

# https://devenv.sh/git-hooks/
# git-hooks.hooks.shellcheck.enable = true;

# See full reference at https://devenv.sh/reference/options/
}
18 changes: 18 additions & 0 deletions devenv.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# yaml-language-server: $schema=https://devenv.sh/devenv.schema.json
inputs:
nixpkgs:
url: github:cachix/devenv-nixpkgs/rolling

# If you're using non-OSS software, you can set allow_unfree to true.
# allow_unfree: true

# If you're not willing to allow unsupported packages:
# allow_unsupported_system: false

# If you're willing to use a package that's vulnerable
# permitted_insecure_packages:
# - "openssl-1.1.1w"

# If you have more than one devenv you can merge them
#imports:
# - ./backend
3 changes: 3 additions & 0 deletions requirement.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
requests
rich
python-dotenv
7 changes: 7 additions & 0 deletions src/help.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
def help():
print("Welcome to ctOS, the cli for Tranquillity\n")
print("Usage : ctOS [command]")
print(" ctOS [flags]\n")
print("[command] :\n")
print(" --light toggle (toggle connected light)")
print(" --music (use command for music)")
15 changes: 15 additions & 0 deletions src/light/light.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import os
import sys
from src.light.toggle_light import toggle_light

def light_command():
nb = len(sys.argv)

if nb <= 2:
print("no argument give. Please give word")
return
if sys.argv[2] == "toggle":
toggle_light()
return
else:
print("no argument give. Please give word")
18 changes: 18 additions & 0 deletions src/light/toggle_light.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import os
import subprocess

FIFO_PATH = "/tmp/kitty_shell_input"
CMD_LIGHT = "./ecc-api --toggle"

def toggle_light():
if not os.path.exists(FIFO_PATH):
print(f"Sub-Agent: FIFO introuvable: {FIFO_PATH}")
return
with open(FIFO_PATH, "w") as fifo:
fifo.write(CMD_LIGHT + "\n")
subprocess.run(CMD_LIGHT)
return

def toggle_light():
subprocess.run(CMD_LIGHT)
return
17 changes: 17 additions & 0 deletions src/music/get_id_device.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import requests
import json
import sys
from src.music.get_token_tmp import get_token
import requests

def get_id_device():
access_token = get_token()
url = "https://api.spotify.com/v1/me/player/devices"
header = {"Authorization": "Bearer " + access_token}

result = requests.get(url, headers=header)
try:
body = result.json()
except Exception:
body = result.text
print(body)
Loading