@tanagram/cli 0.1.24 → 0.1.26

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -236,4 +236,4 @@ Then run `tanagram` to enforce them locally!
236
236
 
237
237
  ---
238
238
 
239
- Built by [@fluttermatt](https://x.com/fluttermatt) and the Tanagram team. Talk to us [on Twitter](https://x.com/tanagram_) or email: founders AT tanagram.ai
239
+ Built by [@fluttermatt](https://x.com/fluttermatt) and the [Tanagram](https://tanagram.ai/) team. Talk to us [on Twitter](https://x.com/tanagram_) or email: founders AT tanagram.ai
package/go.mod CHANGED
@@ -1,15 +1,34 @@
1
1
  module github.com/tanagram/cli
2
2
 
3
- go 1.23.0
3
+ go 1.24.0
4
4
 
5
5
  require github.com/anthropics/anthropic-sdk-go v1.17.0
6
6
 
7
7
  require (
8
+ github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect
9
+ github.com/charmbracelet/bubbletea v1.3.10 // indirect
10
+ github.com/charmbracelet/colorprofile v0.2.3-0.20250311203215-f60798e515dc // indirect
11
+ github.com/charmbracelet/lipgloss v1.1.0 // indirect
12
+ github.com/charmbracelet/x/ansi v0.10.1 // indirect
13
+ github.com/charmbracelet/x/cellbuf v0.0.13-0.20250311204145-2c3ea96c31dd // indirect
14
+ github.com/charmbracelet/x/term v0.2.1 // indirect
15
+ github.com/erikgeiser/coninput v0.0.0-20211004153227-1c3628e74d0f // indirect
8
16
  github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect
17
+ github.com/lucasb-eyer/go-colorful v1.2.0 // indirect
18
+ github.com/mattn/go-isatty v0.0.20 // indirect
19
+ github.com/mattn/go-localereader v0.0.1 // indirect
20
+ github.com/mattn/go-runewidth v0.0.16 // indirect
21
+ github.com/muesli/ansi v0.0.0-20230316100256-276c6243b2f6 // indirect
22
+ github.com/muesli/cancelreader v0.2.2 // indirect
23
+ github.com/muesli/termenv v0.16.0 // indirect
9
24
  github.com/posthog/posthog-go v1.6.12 // indirect
25
+ github.com/rivo/uniseg v0.4.7 // indirect
10
26
  github.com/stretchr/testify v1.10.0 // indirect
11
27
  github.com/tidwall/gjson v1.18.0 // indirect
12
28
  github.com/tidwall/match v1.1.1 // indirect
13
29
  github.com/tidwall/pretty v1.2.1 // indirect
14
30
  github.com/tidwall/sjson v1.2.5 // indirect
31
+ github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e // indirect
32
+ golang.org/x/sys v0.36.0 // indirect
33
+ golang.org/x/text v0.27.0 // indirect
15
34
  )
package/go.sum CHANGED
@@ -1,13 +1,46 @@
1
1
  github.com/anthropics/anthropic-sdk-go v1.17.0 h1:BwK8ApcmaAUkvZTiQE0yi3R9XneEFskDIjLTmOAFZxQ=
2
2
  github.com/anthropics/anthropic-sdk-go v1.17.0/go.mod h1:WTz31rIUHUHqai2UslPpw5CwXrQP3geYBioRV4WOLvE=
3
+ github.com/aymanbagabas/go-osc52/v2 v2.0.1 h1:HwpRHbFMcZLEVr42D4p7XBqjyuxQH5SMiErDT4WkJ2k=
4
+ github.com/aymanbagabas/go-osc52/v2 v2.0.1/go.mod h1:uYgXzlJ7ZpABp8OJ+exZzJJhRNQ2ASbcXHWsFqH8hp8=
5
+ github.com/charmbracelet/bubbletea v1.3.10 h1:otUDHWMMzQSB0Pkc87rm691KZ3SWa4KUlvF9nRvCICw=
6
+ github.com/charmbracelet/bubbletea v1.3.10/go.mod h1:ORQfo0fk8U+po9VaNvnV95UPWA1BitP1E0N6xJPlHr4=
7
+ github.com/charmbracelet/colorprofile v0.2.3-0.20250311203215-f60798e515dc h1:4pZI35227imm7yK2bGPcfpFEmuY1gc2YSTShr4iJBfs=
8
+ github.com/charmbracelet/colorprofile v0.2.3-0.20250311203215-f60798e515dc/go.mod h1:X4/0JoqgTIPSFcRA/P6INZzIuyqdFY5rm8tb41s9okk=
9
+ github.com/charmbracelet/lipgloss v1.1.0 h1:vYXsiLHVkK7fp74RkV7b2kq9+zDLoEU4MZoFqR/noCY=
10
+ github.com/charmbracelet/lipgloss v1.1.0/go.mod h1:/6Q8FR2o+kj8rz4Dq0zQc3vYf7X+B0binUUBwA0aL30=
11
+ github.com/charmbracelet/x/ansi v0.10.1 h1:rL3Koar5XvX0pHGfovN03f5cxLbCF2YvLeyz7D2jVDQ=
12
+ github.com/charmbracelet/x/ansi v0.10.1/go.mod h1:3RQDQ6lDnROptfpWuUVIUG64bD2g2BgntdxH0Ya5TeE=
13
+ github.com/charmbracelet/x/cellbuf v0.0.13-0.20250311204145-2c3ea96c31dd h1:vy0GVL4jeHEwG5YOXDmi86oYw2yuYUGqz6a8sLwg0X8=
14
+ github.com/charmbracelet/x/cellbuf v0.0.13-0.20250311204145-2c3ea96c31dd/go.mod h1:xe0nKWGd3eJgtqZRaN9RjMtK7xUYchjzPr7q6kcvCCs=
15
+ github.com/charmbracelet/x/term v0.2.1 h1:AQeHeLZ1OqSXhrAWpYUtZyX1T3zVxfpZuEQMIQaGIAQ=
16
+ github.com/charmbracelet/x/term v0.2.1/go.mod h1:oQ4enTYFV7QN4m0i9mzHrViD7TQKvNEEkHUMCmsxdUg=
3
17
  github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
4
18
  github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
19
+ github.com/erikgeiser/coninput v0.0.0-20211004153227-1c3628e74d0f h1:Y/CXytFA4m6baUTXGLOoWe4PQhGxaX0KpnayAqC48p4=
20
+ github.com/erikgeiser/coninput v0.0.0-20211004153227-1c3628e74d0f/go.mod h1:vw97MGsxSvLiUE2X8qFplwetxpGLQrlU1Q9AUEIzCaM=
5
21
  github.com/hashicorp/golang-lru/v2 v2.0.7 h1:a+bsQ5rvGLjzHuww6tVxozPZFVghXaHOwFs4luLUK2k=
6
22
  github.com/hashicorp/golang-lru/v2 v2.0.7/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM=
23
+ github.com/lucasb-eyer/go-colorful v1.2.0 h1:1nnpGOrhyZZuNyfu1QjKiUICQ74+3FNCN69Aj6K7nkY=
24
+ github.com/lucasb-eyer/go-colorful v1.2.0/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i7ruzyGqttikkLy0=
25
+ github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY=
26
+ github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
27
+ github.com/mattn/go-localereader v0.0.1 h1:ygSAOl7ZXTx4RdPYinUpg6W99U8jWvWi9Ye2JC/oIi4=
28
+ github.com/mattn/go-localereader v0.0.1/go.mod h1:8fBrzywKY7BI3czFoHkuzRoWE9C+EiG4R1k4Cjx5p88=
29
+ github.com/mattn/go-runewidth v0.0.16 h1:E5ScNMtiwvlvB5paMFdw9p4kSQzbXFikJ5SQO6TULQc=
30
+ github.com/mattn/go-runewidth v0.0.16/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w=
31
+ github.com/muesli/ansi v0.0.0-20230316100256-276c6243b2f6 h1:ZK8zHtRHOkbHy6Mmr5D264iyp3TiX5OmNcI5cIARiQI=
32
+ github.com/muesli/ansi v0.0.0-20230316100256-276c6243b2f6/go.mod h1:CJlz5H+gyd6CUWT45Oy4q24RdLyn7Md9Vj2/ldJBSIo=
33
+ github.com/muesli/cancelreader v0.2.2 h1:3I4Kt4BQjOR54NavqnDogx/MIoWBFa0StPA8ELUXHmA=
34
+ github.com/muesli/cancelreader v0.2.2/go.mod h1:3XuTXfFS2VjM+HTLZY9Ak0l6eUKfijIfMUZ4EgX0QYo=
35
+ github.com/muesli/termenv v0.16.0 h1:S5AlUN9dENB57rsbnkPyfdGuWIlkmzJjbFf0Tf5FWUc=
36
+ github.com/muesli/termenv v0.16.0/go.mod h1:ZRfOIKPFDYQoDFF4Olj7/QJbW60Ol/kL1pU3VfY/Cnk=
7
37
  github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
8
38
  github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
9
39
  github.com/posthog/posthog-go v1.6.12 h1:rsOBL/YdMfLJtOVjKJLgdzYmvaL3aIW6IVbAteSe+aI=
10
40
  github.com/posthog/posthog-go v1.6.12/go.mod h1:LcC1Nu4AgvV22EndTtrMXTy+7RGVC0MhChSw7Qk5XkY=
41
+ github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
42
+ github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ=
43
+ github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88=
11
44
  github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
12
45
  github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
13
46
  github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
@@ -22,5 +55,13 @@ github.com/tidwall/pretty v1.2.1 h1:qjsOFOWWQl+N3RsoF5/ssm1pHmJJwhjlSbZ51I6wMl4=
22
55
  github.com/tidwall/pretty v1.2.1/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU=
23
56
  github.com/tidwall/sjson v1.2.5 h1:kLy8mja+1c9jlljvWTlSazM7cKDRfJuR/bOJhcY5NcY=
24
57
  github.com/tidwall/sjson v1.2.5/go.mod h1:Fvgq9kS/6ociJEDnK0Fk1cpYF4FIW6ZF7LAe+6jwd28=
58
+ github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e h1:JVG44RsyaB9T2KIHavMF/ppJZNG9ZpyihvCd0w101no=
59
+ github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e/go.mod h1:RbqR21r5mrJuqunuUZ/Dhy/avygyECGrLceyNeo4LiM=
60
+ golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
61
+ golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
62
+ golang.org/x/sys v0.36.0 h1:KVRy2GtZBrk1cBYA7MKu5bEZFxQk4NIDV6RLVcC8o0k=
63
+ golang.org/x/sys v0.36.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks=
64
+ golang.org/x/text v0.27.0 h1:4fGWRpyh641NLlecmyl4LOe6yDdfaYNrGb2zdfo4JV4=
65
+ golang.org/x/text v0.27.0/go.mod h1:1D28KMCvyooCX9hBiosv5Tz/+YLxj0j7XhWjpSUF7CU=
25
66
  gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
26
67
  gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
package/main.go CHANGED
@@ -6,6 +6,7 @@ import (
6
6
 
7
7
  "github.com/tanagram/cli/commands"
8
8
  "github.com/tanagram/cli/metrics"
9
+ "github.com/tanagram/cli/tui"
9
10
  )
10
11
 
11
12
  func main() {
@@ -36,6 +37,36 @@ func main() {
36
37
  "command": "list",
37
38
  })
38
39
  err = commands.List()
40
+ case "welcome":
41
+ metrics.Track("command.execute", map[string]interface{}{
42
+ "command": "welcome",
43
+ })
44
+ choice, err := tui.RunWelcomeScreen()
45
+ if err != nil {
46
+ fmt.Fprintf(os.Stderr, "Error: %v\n", err)
47
+ os.Exit(1)
48
+ }
49
+ switch choice {
50
+ case tui.ChoiceImportPolicies:
51
+ fmt.Println("\n✓ Selected: Import policies from Tanagram")
52
+ fmt.Println(" (This feature will be implemented to connect to Tanagram cloud)")
53
+ case tui.ChoiceLocalMode:
54
+ fmt.Println("\n✓ Selected: Continue with local (no sign in)")
55
+ fmt.Println(" Continuing with local policy enforcement...")
56
+ case tui.ChoiceNone:
57
+ fmt.Println("\nNo selection made")
58
+ }
59
+ return
60
+ case "puzzle":
61
+ metrics.Track("command.execute", map[string]interface{}{
62
+ "command": "puzzle",
63
+ })
64
+ err := tui.RunPuzzleEditor()
65
+ if err != nil {
66
+ fmt.Fprintf(os.Stderr, "Error: %v\n", err)
67
+ os.Exit(1)
68
+ }
69
+ return
39
70
  case "help", "-h", "--help":
40
71
  printHelp()
41
72
  return
@@ -65,6 +96,8 @@ COMMANDS:
65
96
  run Check git changes against policies (default)
66
97
  sync Manually sync instruction files to cache
67
98
  list Show all cached policies
99
+ welcome Show interactive welcome screen with setup options
100
+ puzzle Interactive tangram puzzle editor
68
101
  help Show this help message
69
102
 
70
103
  EXAMPLES:
@@ -72,6 +105,8 @@ EXAMPLES:
72
105
  tanagram run # Same as above
73
106
  tanagram sync # Manually sync policies
74
107
  tanagram list # View all cached policies
108
+ tanagram welcome # Show interactive welcome screen
109
+ tanagram puzzle # Launch tangram puzzle editor
75
110
 
76
111
  INSTRUCTION FILES:
77
112
  Tanagram looks for instruction files in your git repository:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tanagram/cli",
3
- "version": "0.1.24",
3
+ "version": "0.1.26",
4
4
  "description": "Tanagram - Catch sloppy code before it ships",
5
5
  "main": "index.js",
6
6
  "bin": {
@@ -42,10 +42,12 @@
42
42
  "metrics/",
43
43
  "parser/",
44
44
  "storage/",
45
+ "tui/",
45
46
  "main.go",
46
47
  "go.mod",
47
48
  "go.sum",
48
49
  "install.js",
50
+ "tanagram-config.json",
49
51
  "README.md",
50
52
  "LICENSE"
51
53
  ]
@@ -0,0 +1,72 @@
1
+ [
2
+ {
3
+ "id": 1,
4
+ "type": "small-triangle",
5
+ "position": {
6
+ "X": 22,
7
+ "Y": 8
8
+ },
9
+ "rotation": 180,
10
+ "flipped": true
11
+ },
12
+ {
13
+ "id": 2,
14
+ "type": "small-triangle",
15
+ "position": {
16
+ "X": 52,
17
+ "Y": 16
18
+ },
19
+ "rotation": 0,
20
+ "flipped": true
21
+ },
22
+ {
23
+ "id": 3,
24
+ "type": "medium-triangle",
25
+ "position": {
26
+ "X": 68,
27
+ "Y": 7
28
+ },
29
+ "rotation": 0,
30
+ "flipped": false
31
+ },
32
+ {
33
+ "id": 4,
34
+ "type": "large-triangle",
35
+ "position": {
36
+ "X": 48,
37
+ "Y": 20
38
+ },
39
+ "rotation": 315,
40
+ "flipped": true
41
+ },
42
+ {
43
+ "id": 5,
44
+ "type": "large-triangle",
45
+ "position": {
46
+ "X": 22,
47
+ "Y": 7
48
+ },
49
+ "rotation": 0,
50
+ "flipped": true
51
+ },
52
+ {
53
+ "id": 6,
54
+ "type": "square",
55
+ "position": {
56
+ "X": 50,
57
+ "Y": 7
58
+ },
59
+ "rotation": 0,
60
+ "flipped": false
61
+ },
62
+ {
63
+ "id": 7,
64
+ "type": "parallelogram",
65
+ "position": {
66
+ "X": 50,
67
+ "Y": 16
68
+ },
69
+ "rotation": 135,
70
+ "flipped": true
71
+ }
72
+ ]