Skip to content

Commit

Permalink
docs: added details, MIT License added
Browse files Browse the repository at this point in the history
  • Loading branch information
wilfreud committed Apr 30, 2024
1 parent ba661bf commit 3d4b616
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 17 deletions.
24 changes: 24 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
(The MIT License)

Copyright (c) 2017-2023
Kamil Mysliwiec <https://kamilmysliwiec.com>
Thomas Ricart <[email protected]>

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
'Software'), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
34 changes: 23 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,30 +1,32 @@
# Quirgo CLI

Quirgo is a tool built to easily configure repositories' secrets and variables.
Quirgo is a command line interface tool built to easily configure repository secrets and variables. It assists in the process of automating application deployment with features such as batch sets of secrets/variables by providing an easy way to perform CRUD (Create | Read | Update | Delete) operations on them.

## Installation

```
Install Quirgo globally by running:

```sh
yarn add -g quirgo
```

or

```
```sh
pnpm add -g quirgo
```

or

```
```sh
npm install -g quirgo
```

## Usage

To start using Quirgo, run:

```
```sh
quirgo
```

Expand All @@ -42,22 +44,32 @@ quirgo

### Example

```bash
The following example shows how to set a list of secrets loaded from a .env file in one command:

```sh
quirgo secrets set --token=xxxxxxxxx --repo=repository --owner=owner --env=/path/to/env/file
```

### File parsing

It is possible to load variables/secrets from .env and .json files, as long as the key-value format is respected.
The .json file would need to resect this format:
The json file look like this:

```json
{
"KEY_1": "VALUE_1",
"KEY_2": "VALUE_2"
}
{ "KEY": "VALUE" }
```

### Notes

To run Quirgo requires at least the following permissions

- Read/write access to repository secrets and variables
- Read access to user information (specifically the user's username).

For more information about the profile information Quirgo has access to, see the official [GitHub API documentation](https://docs.github.com/en/rest/users/users?apiVersion=2022-11-28#get-the-authenticated-user).

Quirgo uses the public Github API under the hood, so you will need a [Personal Access Token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens) (--token) to perform any action. If you'd like to define specific permissions for a P.A.T., read [this](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens#creating-a-fine-grained-personal-access-token).

## License

Quirgo is [MIT licensed](LICENSE).
7 changes: 3 additions & 4 deletions TODO.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
## Todo

- Replace OctokitResponse<any> by proper typing!
- Consider writing tests (unit tests and whatnot)
- Add warning about gitbub's rate limit (docs)
- Consider writing tests (unit tests)
- Add a mini logger lib file
- Handle verbose properly

## From feedback

- [x] use more branches (e.g. `main`, `develop`, `feature/...`, `bugfix/...`), moost of them will be temporary till reviewing process
- [x] see if owner can be retrieved from GitHub access token, use default as username
- [ ] better README
- [x] better README
- [ ] donner plus d'infos pour l'access token, permettre d'obtenir un lien pour le générer avec peut-etre en query params de quoi remplir le formulaire avec le minimum requis pour l'access token
- [ ] preciser les permissions accordees a quirgo sont les permissions minimales requises
- [x] preciser les permissions accordees a quirgo sont les permissions minimales requises
- [ ] donner la possibilite de stocker le token, voire meme plusieurs
- [x] set verbose to false at default in configuration
- [x] mutual exclusion for options --json && --env
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"lint": "tsc"
},
"keywords": [],
"author": "wilfreud",
"author": "Commodore64",
"license": "MIT",
"dependencies": {
"@inquirer/prompts": "^4.3.2",
Expand Down
5 changes: 4 additions & 1 deletion src/lib/repository-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@ export class RepoManager {
spinner.stopAndPersist();
spinner.start("Authenticating...");
const user = await this.app.rest.users.getAuthenticated();
spinner.stop().clear();
spinner.stopAndPersist({
symbol: "✔️",
text: "Authenticated",
});
return user.data.login;
}

Expand Down

0 comments on commit 3d4b616

Please sign in to comment.