Skip to content

Commit 46c4968

Browse files
committed
Merge branch 'main' into add-expo-plugin
2 parents 994df86 + 84b95a5 commit 46c4968

84 files changed

Lines changed: 2568 additions & 120 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.github/workflows/check-flake.yml‎

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Check Nix flake
22
on:
33
pull_request:
44
paths:
5-
- '**.nix'
5+
- "**.nix"
66
- flake.lock
77
push:
88
branches:
@@ -11,9 +11,11 @@ jobs:
1111
check-flake:
1212
runs-on: ubuntu-latest
1313
steps:
14-
- uses: actions/checkout@v4
15-
- uses: DeterminateSystems/nix-installer-action@main
16-
- uses: DeterminateSystems/magic-nix-cache-action@main
14+
- uses: actions/checkout@v6
15+
- uses: DeterminateSystems/nix-installer-action@v22
16+
- uses: DeterminateSystems/magic-nix-cache-action@v13
17+
with:
18+
use-flakehub: false
1719
- name: Check Nix flake inputs
1820
uses: DeterminateSystems/flake-checker-action@v5
1921
with:

‎.github/workflows/test.yaml‎

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,28 @@
11
name: Test and Validate
22
on:
33
push:
4+
branches: [main]
45
paths-ignore:
5-
- '**.md'
6-
- '.github/ISSUE_TEMPLATE/**'
6+
- "**.md"
7+
- ".github/ISSUE_TEMPLATE/**"
78
pull_request:
89
paths-ignore:
9-
- '**.md'
10-
- '.github/ISSUE_TEMPLATE/**'
10+
- "**.md"
11+
- ".github/ISSUE_TEMPLATE/**"
1112

1213
jobs:
1314
build:
1415
name: Test
1516
runs-on: ubuntu-latest
1617
steps:
18+
- name: Check out code into the Go module directory
19+
uses: actions/checkout@v6
20+
1721
- name: Set up Go 1.x
18-
uses: actions/setup-go@v3
22+
uses: actions/setup-go@v6
1923
with:
2024
go-version: ^1.18
2125

22-
- name: Check out code into the Go module directory
23-
uses: actions/checkout@v3
24-
2526
- name: Test
2627
run: make test
2728

@@ -31,17 +32,17 @@ jobs:
3132
name: Lint
3233
runs-on: ubuntu-latest
3334
steps:
35+
- name: Check out code
36+
uses: actions/checkout@v6
37+
3438
- name: "Set up Go 1.x"
35-
uses: actions/setup-go@v3
39+
uses: actions/setup-go@v6
3640
with:
3741
go-version: 1.19
3842

39-
- name: Check out code
40-
uses: actions/checkout@v3
41-
42-
- name: Lint with golanci-lint
43-
uses: golangci/golangci-lint-action@v3
43+
- name: Lint with golangci-lint
44+
uses: golangci/golangci-lint-action@v9
4445
with:
4546
# version of golangci-lint to use
4647
# Version should stay in sync with version used for local linting (lint job in Makefile).
47-
version: v1.50.1
48+
version: v2.12.2

‎.github/workflows/update-flake-dependencies.yml‎

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,17 @@
22
name: Update flake dependencies
33
on:
44
schedule:
5-
- cron: '0 16 * * 5'
5+
- cron: "0 16 * * 5"
66
workflow_dispatch: # for allowing manual triggers of the workflow
77
jobs:
88
update-dependencies:
99
runs-on: ubuntu-latest
1010
steps:
11-
- uses: actions/checkout@v4
12-
- uses: DeterminateSystems/nix-installer-action@main
13-
- uses: DeterminateSystems/magic-nix-cache-action@main
11+
- uses: actions/checkout@v6
12+
- uses: DeterminateSystems/nix-installer-action@v22
13+
- uses: DeterminateSystems/magic-nix-cache-action@v13
14+
with:
15+
use-flakehub: false
1416
- name: Update flake.lock and create signed commit with flake.lock changes
1517
env:
1618
GITHUB_TOKEN: ${{ secrets.OP_BOT_TOKEN }}
@@ -23,7 +25,7 @@ jobs:
2325
# if branch exists on remote already
2426
BRANCH_EXISTS=false
2527
if git checkout "$COMMIT_BRANCH" > /dev/null 2>&1; then
26-
# pull changes
28+
# pull changeshttps://github.com/1Password/shell-plugins/pull/595
2729
git pull
2830
BRANCH_EXISTS=true
2931
else
@@ -38,7 +40,7 @@ jobs:
3840
# commit via the GitHub API so we get automatic commit signing
3941
gh api --method PUT /repos/1Password/shell-plugins/contents/$FILE_TO_COMMIT \
4042
--field message="$COMMIT_MESSAGE" \
41-
--field content=@<(base64 -i $FILE_TO_COMMIT) \
43+
--field content="$(base64 -w 0 $FILE_TO_COMMIT)" \
4244
--field branch="$COMMIT_BRANCH" \
4345
--field sha="$(git rev-parse $COMMIT_BRANCH:$FILE_TO_COMMIT)"
4446
if [ "$BRANCH_EXISTS" = "false" ]; then

‎.golangci.yml‎

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,27 @@
1+
version: "2"
12
linters:
2-
disable-all: true
3+
default: none
34
enable:
45
# Defaults:
56
- errcheck
6-
- gosimple
77
- govet
88
- ineffassign
9-
- staticcheck
10-
- typecheck
119
- unused
1210
# Extra:
1311
- asciicheck
1412
- bidichk
1513
- depguard
16-
- goimports
17-
- gofmt
14+
- staticcheck
1815

19-
linters-settings:
20-
depguard:
21-
list-type: blacklist
22-
include-go-root: false
23-
packages:
24-
- math/rand
25-
packages-with-error-message:
26-
- math/rand: "please use the safer crypto/rand"
16+
settings:
17+
depguard:
18+
rules:
19+
main:
20+
deny:
21+
- pkg: math/rand
22+
desc: "please use the safer crypto/rand"
23+
24+
formatters:
25+
enable:
26+
- gofmt
27+
- goimports

‎Makefile‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ test:
4444

4545
lint:
4646
# Version used should stay in sync with version in CI (.github/workflows/test.yaml).
47-
docker run --rm -v $(pwd):/app -w /app golangci/golangci-lint:v1.50.1 golangci-lint run
47+
docker run --rm -v $(pwd):/app -w /app golangci/golangci-lint:v2.12.2 golangci-lint run
4848

4949
%/remove-local: beta-notice
5050
$(eval plugin := $(firstword $(subst /, ,$@)))

‎README.md‎

Lines changed: 49 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222

2323
No more plaintext credentials in your home directory. Automatically authenticate every CLI you use with [1Password CLI](https://developer.1password.com/docs/cli/) + [Shell Plugins](https://developer.1password.com/docs/cli/shell-plugins/). Approve temporary credential usage in your terminal with biometrics.
2424

25+
*By accessing or using 1Password Developer Tools, you agree to the [API and SDK Terms of Service](https://1password.com/legal/api-sdk-terms-of-service).*
26+
2527
## 🪄 See it in action!
2628
<p align="center">
2729
<picture>
@@ -63,8 +65,54 @@ Still not sure where or how to begin? We're happy to help! You can:
6365
- Book a free [pairing session](https://calendly.com/d/grs-x2h-pmb/1password-shell-plugins-pairing-session) with one of our developers
6466
- Join the [Developer Slack workspace](https://developer.1password.com/joinslack), and ask us any questions there
6567

68+
## Advanced Configuration
69+
### Managing shell plugins in your own dotfiles
70+
71+
By default, `op plugin init` writes its configuration to `~/.config/op/plugins.sh`
72+
and manages that file for you. If you'd rather keep your plugin configuration in
73+
your own dotfiles (for example, tracked in version control), you can define the
74+
shell functions yourself and source them in your shell's configuration file.
75+
76+
### Step 1: Define the plugin functions
77+
Shell functions for each shell should follow this pattern. In this case,
78+
79+
### bash / zsh
80+
81+
```bash
82+
gh() {
83+
op plugin run -- gh "$@"
84+
}
85+
```
86+
87+
### fish
88+
89+
```fish
90+
function gh --wraps gh --description "1Password shell plugin for GitHub CLI"
91+
op plugin run -- gh $argv
92+
end
93+
```
94+
95+
### Step 2: Tell `op` your plugins are already configured
96+
97+
Set `OP_PLUGIN_ALIASES_SOURCED=1` so 1Password CLI knows the shell plugins have
98+
already been set up:
99+
100+
### bash / zsh
101+
102+
```bash
103+
export OP_PLUGIN_ALIASES_SOURCED="1"
104+
```
105+
106+
### fish
107+
```fish
108+
set -x OP_PLUGIN_ALIASES_SOURCED 1
109+
```
110+
111+
> **Note:** `op plugin init <plugin>` edits `~/.config/op/plugins.sh` directly and won't update your own dotfiles, so configure plugins manually as shown above.
112+
113+
66114
## 💙 Community & Support
67115

68116
- File an [issue](https://github.com/1Password/shell-plugins/issues/new/choose) for bugs and feature requests
69117
- Join the [Developer Slack workspace](https://developer.1password.com/joinslack)
70-
- Subscribe to the [Developer Newsletter](https://1password.com/dev-subscribe/)
118+
- Subscribe to the [Developer Newsletter](https://1password.com/dev-subscribe/)

‎flake.lock‎

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎nix/home-manager.nix‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
{ pkgs, lib, config, ... }:
1+
{
2+
pkgs,
3+
lib,
4+
config,
5+
...
6+
}:
27
import ./shell-plugins.nix {
38
inherit pkgs;
49
inherit lib;

‎nix/nixos.nix‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
{ pkgs, lib, config, ... }:
1+
{
2+
pkgs,
3+
lib,
4+
config,
5+
...
6+
}:
27
import ./shell-plugins.nix {
38
inherit pkgs;
49
inherit lib;

0 commit comments

Comments
 (0)