Skip to content

mightymatth/arcli

Repository files navigation

arcli

Go Report Card arcli

arcli - Awesome Redmine CLI

arcli is CLI for Redmine that simplifies some actions such as checking for issue details and tracking time. It supports Redmine v3.3.1+ (tested with v3.3.1 and v4.1.0).

Quick examples

Listing (ls) all assigned issues (i) to current user.

➜  ~ arcli i ls  
    ID  PROJECT           SUBJECT                   URL                                       
 20123  Webshop           Managing users            https://custom.url.com/issues/20123 
 20660  Webshop Android   Notification management   https://custom.url.com/issues/20460 

Log spent time (l) for issue (i) with ID 20123 with time duration (-t) of 1.5 hours.

➜  ~ arcli l i 20123 -t 1.5
Time entry created!
 ENTRY ID  PROJECT NAME  ISSUE ID  HOURS  ACTIVITY     COMMENT  SPENT ON        
 39458     Webshop       20123     1.5    programming           Thu, 2020-03-12 

Show tracking time status.

➜  ~ arcli status
[324] John Doe (john.doe@email.com)
PERIOD       HOURS   H/LOG   # of I   # of P  
Today        0       0       0        0       
Yesterday    0       0       0        0       
This Week    0       0       0        0       
Last Week    40      6.7     3        2       
This Month   40      6.7     3        2       
Last Month   160     5.5     8        6 

Installation

macOS

$ brew tap mightymatth/arcli https://github.com/mightymatth/arcli
$ brew install arcli

Linux

Get it from the Snap Store

snap install arcli

Usage

➜  ~ arcli -h
Awesome Redmine CLI. Wrapper around Redmine API

Usage:
  arcli [flags]
  arcli [command]

Available Commands:
  aliases     Words that can be used instead of issue or project ids
  completion  Generate the autocompletion script for the specified shell
  defaults    User session defaults
  help        Help about any command
  issues      Shows issue details
  log         Time entries on projects and issues
  login       Opens login interactive login session
  logout      Logout current user
  projects    Shows project details
  search      Search Redmine
  status      Overall account info

Flags:
  -h, --help      help for arcli
  -v, --version   Current arcli and supported Redmine API version

Use "arcli [command] --help" for more information about a command.

Development

# start local Redmine server
docker compose up -d

# use `go run main.go <command>` instead of `arcli <command>`

# login with admin user (username: admin, password: admin)
go run main.go login inline -s http://localhost:3000 -u admin -p admin

# shut down Redmine server
docker compose down

Release

CLI is released using goreleaser via GitHub Releases, using GitHub Actions.

To run a dry release locally, install goreleaser and run:

goreleaser release --skip-publish --skip-validate --clean

... and the artifacts will be in dist/.

FAQ

My username and password is correct, but I get 403. What's the problem?

On freshly installed Redmine server, REST API web service is turned off by default. To turn it on, go to browser, open Redmine server URL, log in with administrator, go to Administrator tab > Settings > API tab and turn on Enable REST web service option.

I have a server with self-signed certificate. How to connect?

You can provide a self-signed certificate in login commands:

arcli login inline -s https://path.to.redmine.server -c path/to/cert/server.crt -u username -p password

To make a local development setup with SSL, check out this guide.