En liten verktøykasse for #team-sykmelding
- Du må ha Node.js installert, husk å bruk verktøy som nvm, mise eller asdf for å håndtere versjoner.
- Du må ha bun.sh installert, dette kan installeres med curl (
curl -fsSL https://bun.sh/install | bash)
Om du installerte node med mise må du køyre desse kommandoane i kommandolinja for å aktivere det.
echo 'eval "$(mise activate zsh --shims)"' >> ~/.zprofile # this sets up non-interactive sessions
echo 'eval "$(mise activate zsh)"' >> ~/.zshrc # this sets up interactive sessionseval "$(mise activate zsh)"
Du må ha en .npmrc fil på root i home-mappen din med følgende innhold:
@navikt:registry=https://npm.pkg.github.com
//npm.pkg.github.com/:_authToken=${NPM_AUTH_TOKEN}
Du må ha en PAT (Personal Access Token) for å kunne laste ned pakker fra Github Package Registry. Denne kan
du lage her. Du må gi den read:packages scope, bruk PAT typen "classic"
Legg til denne i din ~/.bashrc eller ~/.zshrc fil:
export NPM_AUTH_TOKEN=<din token>
export ORG_GRADLE_PROJECT_githubPassword=<din token>
export ORG_GRADLE_PROJECT_githubUser=x-access-tokennpm i -g @navikt/teamsykmelding-cliNå er du klar til å bruke tsm!
doctor- check that all tooling and such looks OKauth- login to gcloudcommits- get the last commits for every repo in the teamprs- get all open pull requestsrepos- get all reposvulns- get all vulnerabilities for the team (Github)builds- checks all repos for failing builds (on main)git- keep our repos in sync, ex: tsm git syncwork- see what has happened the last week (or more)mock- do stuff with the mockteam- get all team memberssync-file- sync a file across specified repossync-cmd- execute a command across multiple repos and stage and commit the changesprimary-branch- get misc repo metadatamob- make a mob commitconfig- set config for tsmupgrade- update the clichangelog- get the latest changes in tsm clianalytics- get your own usage stats for tsm cliopen- open command that opens a project in IntelliJ IDEAweb- open web pagegh- open github repo in browsersearch- search github repos for a given regexsecret- get secretkafka- kafka cli for kafka stuffazure- azure cli for azure stuffdocker- docker stuff
Du kan også bruke tsmx for å interaktivt bytte mellom team, dersom du har satt opp flere team med tsm config --team=<team>.
tsm doctortsm prs --draftstsm buildstsm commitstsm commits --order=asc --limit=10tsm repos --query='cat .yarnrc.yml'Dette kommandolinje-verktøyet er skrevet i TypeScript og bruker bun.sh. For å kjøre det må du først bygge det:
bun installDeretter kan du kjøre det med:
bun run src/index.ts