Skip to content
This repository was archived by the owner on May 20, 2020. It is now read-only.

Commit 2ff9276

Browse files
author
Adam Braimbridge
authored
Merge pull request #57 from Financial-Times/asari
Rename from ika to asari
2 parents 442bbfb + 547e2a0 commit 2ff9276

File tree

8 files changed

+122
-37
lines changed

8 files changed

+122
-37
lines changed

.npmignore

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# dependencies
2+
/node_modules/
3+
4+
# tests
5+
coverage/
6+
reports/
7+
tests/
8+
test/
9+
jest.config.js
10+
11+
# files
12+
.circleci
13+
.github
14+
.babelrc
15+
.editorconfig
16+
.eslintrc.yml
17+
.gitattributes
18+
.gitignore
19+
.npmignore
20+
.idea/
21+
.DS_Store
22+
23+
renovate.json
24+
nodemon.json
25+
ft.yml
26+
Makefile
27+
secret-squirrel.js
28+
yarn.lock
29+
CODEOWNERS

README.md

+82-26
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,35 @@
1-
# 🦑 ika
1+
# 🐚 asari
22

33
## A human-friendly<sup>1</sup> command line tool for the GitHub API.
44

55
<sup>1</sup> It's script-friendly too.
66

7-
![image](https://user-images.githubusercontent.com/224547/57764890-42704180-76fc-11e9-9256-2be2037e2fdf.png)
7+
![image](https://user-images.githubusercontent.com/224547/58557351-1a153680-8216-11e9-9ebc-f25471405ea3.png)
88

9-
> Above: Use `npx ika` in your shell to manage your work in GitHub.
9+
> Above: Use `npx asari` in your shell to manage your work in GitHub.
1010
11-
"Ika" (いか) is [Japanese for squid/cuttlefish](https://translate.google.com/#view=home&op=translate&sl=en&tl=ja&text=Squid). Like a squid, the `ika` command line tool is an elongated, fast-swimming cephalopod mollusk with ten arms (technically, eight arms and two long tentacles), typically able to change color.
11+
"Asari" (あさり) is [Japanese for "clam"](https://translate.google.com/#view=home&op=translate&sl=en&tl=ja&text=clam). Like a clam, `asari` is happiest when it's inside a shell.
1212

13-
`ika` lets you work with GitHub from your shell, and is delicious when lightly fried with garlic and spices.
13+
🐚 `asari` lets you work with GitHub from your command line, and is delicious when lightly fried with garlic and spices.
1414

15-
![image](https://user-images.githubusercontent.com/224547/57698749-3a59c880-764e-11e9-8dc1-92587f4dd884.png)
15+
![image](https://user-images.githubusercontent.com/224547/58558164-010d8500-8218-11e9-9279-9b93307989a7.png)
16+
17+
_Above: Running `npx asari` from your command line shows you the top level of options and commands._
18+
19+
![image](https://user-images.githubusercontent.com/224547/58558212-213d4400-8218-11e9-8b46-42be9ea9d0e9.png)
20+
21+
![image](https://user-images.githubusercontent.com/224547/58558194-15518200-8218-11e9-8d48-0832558413ad.png)
22+
23+
![image](https://user-images.githubusercontent.com/224547/58558179-0c60b080-8218-11e9-8e17-d5823b55c5ad.png)
24+
25+
_Above: Running `npx asari <command>` shows you options for working with GitHub [issues](#working-with-github-issues), [projects](#working-with-github-projects) and [pull requests](#working-with-github-pull-requests)._
1626

1727
## Installation
1828

1929
### Global installation (recommmended)
2030

2131
```bash
22-
npm install --global ika
32+
npm install --global asari
2333
```
2434

2535
When you run the tool, it will automatically notify you if there is a newer version of it available for you to update to.
@@ -29,99 +39,145 @@ When you run the tool, it will automatically notify you if there is a newer vers
2939
### No installation
3040

3141
```bash
32-
npx ika
42+
npx asari
3343
```
3444

3545
The `npx` command lets you use this tool without installing it. However, each time you use `npx` it downloads the whole package from the npm registry, which takes a while. That's why global installation is reccommended.
3646

37-
> Note: If this tool is globally installed, `npx ika` will use that globally installed version rather than downloading.
47+
> Note: If this tool is globally installed, `npx asari` will use that globally installed version rather than downloading.
3848
3949
## Commands
4050

4151
```bash
42-
ika
52+
npx asari
4353

4454
# Display help.
4555
```
4656

4757
```bash
48-
ika <command>
58+
npx asari <command>
4959

5060
# Display help for the command.
5161
```
5262

5363
```bash
54-
ika --version
64+
npx asari --version
5565

5666
# Show the version number.
5767
```
5868

69+
```bash
70+
npx asari allowance
71+
72+
# Display current GitHub API rate-limiting allowance.
73+
```
74+
75+
```bash
76+
npx asari completion
77+
78+
# Output a generated script. To enable bash/zsh completions:
79+
# 1. Install asari globally.
80+
# 2. Add the script to your .bashrc or .bash_profile (or .zshrc for zsh).
81+
```
82+
83+
### Working with GitHub Issues
84+
85+
```bash
86+
npx asari issues create <github-url> [--title] [--body] [--assignees]
87+
88+
# Create a new issue
89+
```
90+
91+
```bash
92+
npx asari issues open <github-url>
93+
94+
# Set the state of an existing issue to `open`
95+
```
96+
97+
```bash
98+
npx asari issues close <github-url>
99+
100+
# Set the state of an existing issue to `closed`
101+
```
102+
103+
```bash
104+
npx asari issues list [--type]
105+
106+
# List all issues assigned to the authenticated user.
107+
```
108+
109+
```bash
110+
npx asari issues list-for-repo <github-url>
111+
112+
# List all issues in a repository.
113+
```
114+
59115
### Working with GitHub Projects
60116

61117
```bash
62-
ika projects add [--column-url] [--url]
118+
npx asari projects add [--column-url] [--url]
63119

64120
# Add a pull request to a GitHub project column.
65121
```
66122

67123
```bash
68-
ika projects close <github-url>
124+
npx asari projects close <github-url>
69125

70126
# Set the state of an existing project board to `closed`.
71127
```
72128

73129
```bash
74-
ika projects create <github-url> [--body]
130+
npx asari projects create <github-url> [--body]
75131

76132
# Create a new project.
77133
```
78134

79135
### Working with GitHub Pull Requests
80136

81137
```bash
82-
ika pulls close <github-url>
138+
npx asari pulls close <github-url>
83139

84140
# Set the state of an existing pull request to `closed`.
85141
```
86142

87143
```bash
88-
ika pulls create-comment <github-url> [--body]
144+
npx asari pulls create-comment <github-url> [--body]
89145

90146
# Create a comment on an existing pull request.
91147
```
92148

93149
```bash
94-
ika pulls create-review-request <github-url> [reviewers|team-reviewers]
150+
npx asari pulls create-review-request <github-url> [reviewers|team-reviewers]
95151

96152
# Request a review for a pull request.
97153
```
98154

99155
```bash
100-
ika pulls create <github-url> [--base] [--body] [--title]
156+
npx asari pulls create <github-url> [--base] [--body] [--title]
101157

102158
# Create a new pull request.
103159
```
104160

105161
```bash
106-
ika pulls delete-comment <github-url>
162+
npx asari pulls delete-comment <github-url>
107163

108164
# Delete a comment on an existing pull request.
109165
```
110166

111167
```bash
112-
ika pulls delete-review-request <github-url> [reviewers|team-reviewers]
168+
npx asari pulls delete-review-request <github-url> [reviewers|team-reviewers]
113169

114170
# Delete a review for a pull request.
115171
```
116172

117173
```bash
118-
ika pulls merge <github-url> [--method]
174+
npx asari pulls merge <github-url> [--method]
119175

120176
# Merge an existing pull request.
121177
```
122178

123179
```bash
124-
ika pulls open <github-url>
180+
npx asari pulls open <github-url>
125181

126182
# Set the state of an existing pull request to `open`.
127183
```
@@ -156,8 +212,8 @@ export $GITHUB_PERSONAL_ACCESS_TOKEN=[your token here]
156212
This project loosely follows the example provided in the Yargs documentation for command hierarchy and directory structure.
157213

158214
- @see: https://github.com/yargs/yargs/blob/master/docs/advanced.md#commanddirdirectory-opts
159-
- @see: [`bin/ika.js`](https://github.com/Financial-Times/ika/blob/master/bin/ika.js) for the root `ika` command.
160-
- @see: [`src/commands`](https://github.com/Financial-Times/ika/blob/master/src/commands/) for the `ika <command>` commands.
215+
- @see: [`bin/asari.js`](https://github.com/Financial-Times/asari/blob/master/bin/asari.js) for the root `asari` command.
216+
- @see: [`src/commands`](https://github.com/Financial-Times/asari/blob/master/src/commands/) for the `asari <command>` commands.
161217

162218
## Conventions
163219

@@ -169,7 +225,7 @@ This project loosely follows the example provided in the Yargs documentation for
169225

170226
### Code formatting and linting
171227

172-
- The [.eslintrc.js](https://github.com/Financial-Times/ika/blob/master/.eslintrc.js) file contains the settings for code linting.
228+
- The [.eslintrc.js](https://github.com/Financial-Times/asari/blob/master/.eslintrc.js) file contains the settings for code linting.
173229

174230
- @see: https://eslint.org/
175231

bin/ika.js bin/asari.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,14 @@ const baseOptions = flow([
1616
commonYargs.withJson(),
1717
])
1818
baseOptions(yargs)
19-
.scriptName('ika')
19+
.scriptName('asari')
2020
.usage('$0 <command> <subcommand> [...options]')
2121
/**
22-
* The --version argument only makes sense as an option for the main `ika` command.
22+
* The --version argument only makes sense as an option for the main `asari` command.
2323
*/
2424
.command('[--version]', 'Show the version number.')
2525
.hide('version')
26-
.completion('completion', 'Output a generated script. To enable bash/zsh completions: \n 1. Install ika globally. \n 2. Add the script to your .bashrc or .bash_profile (or .zshrc for zsh).')
26+
.completion('completion', 'Output a generated script. To enable bash/zsh completions: \n 1. Install asari globally. \n 2. Add the script to your .bashrc or .bash_profile (or .zshrc for zsh).')
2727
/**
2828
* Load our yargs command modules from a directory.
2929
*

package.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
2-
"name": "ika",
2+
"name": "asari",
33
"version": "1.0.0",
4-
"description": "🦑 Ika: A human-friendly command line tool for the GitHub API",
5-
"bin": "bin/ika.js",
4+
"description": "🐚 Asari: A human-friendly command line tool for the GitHub API",
5+
"bin": "bin/asari.js",
66
"scripts": {
77
"test": "npm run lint && npm run unit-test",
88
"unit-test": "jest --coverage",
@@ -13,7 +13,7 @@
1313
"keywords": [],
1414
"repository": {
1515
"type": "git",
16-
"url": "[email protected]:Financial-Times/ika.git"
16+
"url": "[email protected]:Financial-Times/asari.git"
1717
},
1818
"license": "MIT",
1919
"dependencies": {

test/commands/issues/create.test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ const requiredArguments = {
3030
commonTests.describeYargs(yargsModule, command, requiredArguments)
3131

3232
describe('StdIn-compatible options', () => {
33-
const commandString = `./bin/ika.js ${command} https://github.com/Test-Owner/Test-Repo --title 'Test Issue' --token 'Test-Token'`
33+
const commandString = `./bin/asari.js ${command} https://github.com/Test-Owner/Test-Repo --title 'Test Issue' --token 'Test-Token'`
3434
test(`Running the command handler without 'body' NOR 'stdin' throws an error`, async () => {
3535
expect.assertions(1)
3636
try {

test/commands/projects/create.test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ commonTests.describeYargs(yargsModule, command, requiredArguments)
3232
// Todo: Add a test for options with spaces, e.g. { name: 'Test Project' }
3333

3434
describe('StdIn-compatible options', () => {
35-
const commandString = `./bin/ika.js ${command} https://github.com/Test-Owner/Test-Repo --name 'Test Project' --token 'Test-Token'`
35+
const commandString = `./bin/asari.js ${command} https://github.com/Test-Owner/Test-Repo --name 'Test Project' --token 'Test-Token'`
3636
test(`Running the command handler without 'body' NOR 'stdin' throws an error`, async () => {
3737
expect.assertions(1)
3838
try {

test/commands/pulls/merge.test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ describe('Error output', () => {
4949
* So you can only test for errors.
5050
* If you test for successful execution, it will actually try to connect to GitHub.
5151
*/
52-
require('child_process').execSync(`./bin/ika.js ${command} this-is-an-unvalid-github-url`)
52+
require('child_process').execSync(`./bin/asari.js ${command} this-is-an-unvalid-github-url`)
5353
} catch (error) {
5454
expect(error.message).toMatch(new RegExp(`Invalid GitHub URL`, 'i'))
5555
}

test/common-tests.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ const missingOptionWillThrow = (requiredArguments, command) => {
7171
* So you can only test for errors.
7272
* If you test for successful execution, it will actually try to connect to GitHub.
7373
*/
74-
require('child_process').execSync(`./bin/ika.js ${command} ${argumentString}`, { env: testEnv })
74+
require('child_process').execSync(`./bin/asari.js ${command} ${argumentString}`, { env: testEnv })
7575
} catch (error) {
7676
expect(error.message).toMatch(new RegExp(`Missing required argument:\(\[a\-z\\s\]\+\)${argumentName}`, 'i'))
7777
}

0 commit comments

Comments
 (0)