Skip to content

Commit 58a6720

Browse files
authored
Removed login and pull commands, added to the main TUI (#52)
Co-authored-by: Tomas Vesely <448809+wham@users.noreply.github.com>
1 parent 4ef3591 commit 58a6720

File tree

5 files changed

+848
-373
lines changed

5 files changed

+848
-373
lines changed

.github/skills/testing/SKILL.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
---
2+
name: testing
3+
description: Guide for testing TUI (terminal user interface) applications. Use this when asked to verify code changes.
4+
---
5+
6+
# Testing
7+
8+
This skill helps you create and run tests for terminal user interface (TUI) applications.
9+
10+
## When to use this skill
11+
12+
Use this skill when you need to:
13+
- Verify that code changes work as intended
14+
- Ensure existing functionality as specified in `maind.md` and `README.md` is not broken
15+
16+
## Starting the application
17+
18+
- Run `scripts/run` where the user would normally run `github-brain`
19+
- `scripts/run pull` equivalently runs `github-brain pull`
20+
- `scripts/run mcp` equivalently runs `github-brain mcp`
21+
- Ensure `.env` files is configured to use the `github-brain-test` organization
22+
- Use GitHub MCP to add new issue/PRs/discussions as needed for testing
23+
- Simulate user input: Send key presses, control combinations, or specific commands to the running application.
24+
- Capture and analyze screen output: The testing tool captures the terminal display (or buffer) at specific moments in time.
25+
- Make assertions: Verify that the screen content matches the expected output (e.g., checking if specific text is present at certain coordinates or if the cursor position is correct).

AGENTS.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
- The app is coded in Markdown file `main.md` and compiled to Go code using the instructions in `.github/prompts/compile.prompt.md`.
2+
- When prompted to make changes, start by updating `main.md` and letting me to review the changes before compiling again.
3+
- Everything must fit into a single `main.md` / `main.go` file pair. Avoid creating new files.
4+
- `README.md` contains usage instructions. Read it to understand how the app should work.

README.md

Lines changed: 13 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -31,19 +31,17 @@ Or use `npx github-brain` to run without installing globally.
3131
## Usage
3232

3333
```sh
34-
github-brain <command> [<args>]
34+
github-brain
3535
```
3636

37-
**Workflow:**
37+
Launches the interactive TUI where you can:
3838

39-
1. Use `login` to authenticate with GitHub (or set `GITHUB_TOKEN` manually)
40-
2. Use `pull` to populate the local database
41-
3. Use `mcp` to start the MCP server
39+
1. **Login** - Authenticate with GitHub
40+
2. **Pull** - Populate the local database with GitHub data
4241

43-
Re-run `pull` anytime to update the database with new GitHub data.
42+
Re-run pull anytime to update the database with new GitHub data.
4443

45-
Each command has its own arguments. Some can be set via environment variables. The app will also load environment variables from a `.env` file in the GitHub Brain's home directory - `~/.github-brain` by default.
46-
You can change the home directory with the `-m` argument available for all commands.
44+
The app loads environment variables from a `.env` file in the GitHub Brain's home directory - `~/.github-brain` by default.
4745

4846
<details>
4947
<summary>Example .env file</summary>
@@ -53,42 +51,10 @@ You can change the home directory with the `-m` argument available for all comma
5351

5452
</details>
5553

56-
### `login`
57-
58-
Opens your browser to authorize _GitHub Brain_ app and stores resulting `GITHUB_TOKEN` in the `.env` file.
59-
Optionally, you can also specify `ORGANIZATION` to store in the same file.
60-
61-
Example:
62-
63-
```sh
64-
github-brain login
65-
```
66-
6754
| Argument | Description |
6855
| :------- | :----------------------------------------- |
6956
| `-m` | Home directory. Default: `~/.github-brain` |
7057

71-
### `pull`
72-
73-
Populate the local database with GitHub data.
74-
75-
Example:
76-
77-
```sh
78-
github-brain pull -o my-org
79-
```
80-
81-
The first run may take a while. Subsequent runs are faster, fetching only new data.
82-
83-
| Argument | Variable | Description |
84-
| :------- | :---------------------- | :------------------------------------------------------------------------------------------------------------------------------------- |
85-
| | `GITHUB_TOKEN` | Your GitHub token. Use `login` command or create a [personal token](https://github.com/settings/personal-access-tokens). **Required.** |
86-
| `-o` | `ORGANIZATION` | The GitHub organization to pull data from. **Required.** |
87-
| `-m` | | Home directory. Default: `~/.github-brain` |
88-
| `-i` | | Pull only selected entities: `repositories`, `discussions`, `issues`, `pull-requests` (comma-separated). |
89-
| `-f` | | Remove all data before pulling. With `-i`, removes only specified items. |
90-
| `-e` | `EXCLUDED_REPOSITORIES` | Repositories to exclude (comma-separated). Useful for large repos not relevant to your analysis. |
91-
9258
<details>
9359
<summary>Personal access token scopes</summary>
9460

@@ -100,30 +66,18 @@ The first run may take a while. Subsequent runs are faster, fetching only new da
10066

10167
</details>
10268

103-
### `mcp`
104-
105-
Start the MCP server using the local database.
106-
107-
Example:
108-
109-
```sh
110-
github-brain mcp -o my-org
111-
```
112-
113-
| Argument | Variable | Description |
114-
| :------- | :------------- | :------------------------------------------ |
115-
| `-o` | `ORGANIZATION` | GitHub organization. **Required.** |
116-
| `-m` | | Home directory. Default: `~/.github-brain` |
117-
118-
### Additional Arguments
69+
## MCP Server
11970

120-
**Version:**
71+
Start the MCP server using the local database:
12172

12273
```sh
123-
github-brain --version
74+
github-brain mcp
12475
```
12576

126-
Displays the current version (commit hash and build date).
77+
| Argument | Variable | Description |
78+
| :------- | :------------- | :----------------------------------------- |
79+
| `-o` | `ORGANIZATION` | GitHub organization. **Required.** |
80+
| `-m` | | Home directory. Default: `~/.github-brain` |
12781

12882
## MCP Configuration
12983

0 commit comments

Comments
 (0)