Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
9 changes: 9 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Chrome profile to read cookies from. Works on macOS, Linux, and Windows.
# Accepted values:
# - Email address: <firstname>.<lastname>@eficode.com
# - Profile name: Eficode
# - Directory name: Default, Profile 2
#
# If not set, defaults to the first profile with an @eficode.com email.
# If no @eficode.com profile is found, falls back to "Default".
CHROME_PROFILE=
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@
/lib

node_modules

.env
3 changes: 0 additions & 3 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npx lint-staged
3 changes: 0 additions & 3 deletions .husky/pre-push
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npm run typecheck && npm run test
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,20 @@ A simple CLI for Eficode Timesheets

Sign in to [Timesheets](https://timesheets.eficode.fi/) on Chrome.

## Chrome profiles

If you use multiple Chrome profiles, the CLI tries to auto-detect your work profile by looking for one signed in with an `@eficode.com` email. Auto-detect works on macOS, Linux, and Windows.

To override, set the `CHROME_PROFILE` environment variable:

CHROME_PROFILE=your.name@eficode.com # or "Eficode", or "Profile 2"

It accepts the account email, the profile display name, or the directory name (e.g. `Default`, `Profile 2`).

Optionally, you can put it in a `.env` file (see `.env.example`) and load it with Node ≥20.6:

node --env-file=.env lib/cli.js

## Running

`npx @eficode/tscli`
Expand Down
Loading
Loading