-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathapp_structure_llm.txt
More file actions
65 lines (56 loc) · 2.8 KB
/
app_structure_llm.txt
File metadata and controls
65 lines (56 loc) · 2.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# App Structure - flare-cli
# Last updated: 2026-03-17
## Repository
- Local: /Users/paolo/Repos/flare-cli
- Module: github.com/paoloanzn/flare-cli
## Architecture
Go CLI (binary: `flare`) that serves local/containerized apps through
Cloudflare Tunnel with Cloudflare Access authentication.
### Directory Layout
- main.go → Entrypoint, calls cmd.Execute()
- cmd/ → Cobra command tree (one file per command)
- internal/origin/ → Origin interface + 6 origin type implementations
- internal/tunnel/ → Cloudflare Tunnel API manager + cloudflared process
- internal/access/ → Cloudflare Access app/policy API manager
- internal/dns/ → Cloudflare DNS record API manager
- internal/pipeline/ → Serve orchestration (10-step pipeline + teardown)
- internal/session/ → Session state machine + file-based store
- internal/config/ → Viper config wrapper
- internal/exec/ → Subprocess execution helpers
- internal/ui/ → Terminal formatting (lipgloss)
### Key Dependencies
- github.com/cloudflare/cloudflare-go (v0.116.0) — Cloudflare API client
- github.com/spf13/cobra — CLI framework
- github.com/spf13/viper — Config management
- github.com/charmbracelet/lipgloss — Terminal styling
- github.com/google/uuid — Session IDs
### State
- Config: ~/.config/flare-cli/config.yaml
- Sessions: ~/.config/flare-cli/sessions/<uuid>.json
### Commands
- flare init — Bootstrap config for Cloudflare account/zone
- flare serve — Main command: start origin + tunnel + Access
- flare close — Teardown session resources
- flare update — Mutate active session (policy, TTL)
- flare status — Show session details
- flare list — List all sessions
- flare logs — Stream session logs
- flare doctor — Validate prerequisites
- flare auth — Auth utilities (print-login-url, rotate-mtls)
- flare config — Read/write persistent config
- flare version — Print version info
### Origin Types
- local:http — Proxy to existing local HTTP service
- local:command — Launch command, wait for ready, expose
- builtin:static — Serve static files
- builtin:file-browser — Built-in file browser UI
- docker:container — Run Docker container, expose port
- docker:compose-service — Start Compose service, expose port
## Environment Variables Required
- CLOUDFLARE_API_TOKEN — Cloudflare API token with Tunnel Edit, DNS Edit, Access Apps Edit
## Notes
- Uses cloudflare-go v0.116.0 (traditional SDK, not v6 generated client)
- Shells out to cloudflared and docker (not embedded SDKs)
- Remotely-managed tunnels by default (not Quick Tunnels)
- All origins bind to 127.0.0.1 only
- Session state machine: initializing -> provisioning -> active -> stopping -> stopped