Skip to content

Commit 8bf9306

Browse files
committed
Initial commit: DoPlan CLI with complete documentation and features
0 parents  commit 8bf9306

File tree

124 files changed

+23627
-0
lines changed

Some content is hidden

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

124 files changed

+23627
-0
lines changed

.github/workflows/release.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
release:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout code
16+
uses: actions/checkout@v4
17+
with:
18+
fetch-depth: 0
19+
20+
- name: Set up Go
21+
uses: actions/setup-go@v5
22+
with:
23+
go-version: '1.21'
24+
25+
- name: Run GoReleaser
26+
uses: goreleaser/goreleaser-action@v5
27+
with:
28+
distribution: goreleaser
29+
version: ${{ github.ref }}
30+
args: release --clean
31+
env:
32+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
33+
34+
- name: Create Homebrew PR
35+
if: success()
36+
run: |
37+
echo "Homebrew PR creation would happen here"
38+
echo "This typically requires a separate workflow or manual process"
39+
echo "See: https://goreleaser.com/customization/homebrew/"
40+

.gitignore

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Binaries
2+
bin/
3+
dist/
4+
*.exe
5+
*.exe~
6+
*.dll
7+
*.so
8+
*.dylib
9+
10+
# Test binary
11+
*.test
12+
13+
# Output of the go coverage tool
14+
coverage.out
15+
coverage.html
16+
17+
# Dependency directories
18+
vendor/
19+
20+
# Go workspace file
21+
go.work
22+
23+
# IDE
24+
.idea/
25+
.vscode/
26+
*.swp
27+
*.swo
28+
*~
29+
30+
# OS
31+
.DS_Store
32+
Thumbs.db
33+
34+
# Build artifacts
35+
*.tar.gz
36+
checksums.txt
37+
38+
# Local config
39+
.env
40+
.env.local
41+

.goreleaser.yml

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
# .goreleaser.yml
2+
version: 2
3+
project_name: doplan
4+
5+
before:
6+
hooks:
7+
- go mod download
8+
9+
builds:
10+
- env:
11+
- CGO_ENABLED=0
12+
main: ./cmd/doplan
13+
binary: doplan
14+
goos:
15+
- linux
16+
- darwin
17+
- windows
18+
goarch:
19+
- amd64
20+
- arm64
21+
flags:
22+
- -trimpath
23+
ldflags:
24+
- -s -w
25+
- -X main.version={{.Version}}
26+
- -X main.commit={{.Commit}}
27+
- -X main.date={{.Date}}
28+
29+
archives:
30+
- name_template: '{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}'
31+
files:
32+
- README.md
33+
- LICENSE
34+
35+
checksum:
36+
name_template: '{{ .ProjectName }}_{{ .Version }}_checksums.txt'
37+
38+
snapshot:
39+
name_template: "{{ .Tag }}-next" # This will be ignored in v2, but kept for compatibility
40+
41+
changelog:
42+
sort: asc
43+
filters:
44+
exclude:
45+
- '^docs:'
46+
- '^test:'
47+
- '^chore:'
48+
49+
brews:
50+
- name: doplan
51+
homepage: https://github.com/DoPlan-dev/CLI
52+
description: Project workflow automation tool
53+
license: MIT
54+
repository:
55+
owner: DoPlan-dev
56+
name: CLI
57+
test: |
58+
system "#{bin}/doplan --version"
59+
install: |
60+
bin.install "doplan"
61+
62+
nfpms:
63+
- package_name: doplan
64+
vendor: DoPlan
65+
homepage: https://github.com/DoPlan-dev/CLI
66+
maintainer: DoPlan Team <[email protected]>
67+
description: Project workflow automation tool
68+
license: MIT
69+
formats:
70+
- deb
71+
- rpm
72+
bindir: /usr/bin
73+
74+
# Docker builds disabled for initial release - can be enabled later
75+
# dockers:
76+
# - goos: linux
77+
# goarch: amd64
78+
# image_templates:
79+
# - "ghcr.io/doplan-dev/doplan:{{ .Tag }}"
80+
# - "ghcr.io/doplan-dev/doplan:latest"
81+
# dockerfile: Dockerfile
82+
83+
release:
84+
github:
85+
owner: DoPlan-dev
86+
name: CLI

Dockerfile

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
FROM golang:1.21-alpine AS builder
2+
3+
WORKDIR /build
4+
5+
# Install git for go-git dependencies
6+
RUN apk add --no-cache git
7+
8+
COPY go.mod go.sum ./
9+
RUN go mod download
10+
11+
COPY . .
12+
RUN CGO_ENABLED=0 go build -ldflags="-s -w -X main.version=${VERSION:-dev} -X main.commit=${COMMIT:-unknown} -X main.date=${DATE:-unknown}" -o doplan ./cmd/doplan
13+
14+
FROM alpine:latest
15+
16+
RUN apk --no-cache add ca-certificates git
17+
18+
WORKDIR /app
19+
20+
COPY --from=builder /build/doplan .
21+
22+
ENTRYPOINT ["./doplan"]
23+

Formula/doplan.rb

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# typed: false
2+
# frozen_string_literal: true
3+
4+
# This file was generated by GoReleaser. DO NOT EDIT.
5+
class Doplan < Formula
6+
desc "Project workflow automation tool that transforms app ideas into structured development projects"
7+
homepage "https://github.com/DoPlan-dev/CLI"
8+
version "1.0.0"
9+
license "MIT"
10+
bottle :unneeded
11+
12+
on_macos do
13+
if Hardware::CPU.intel?
14+
url "https://github.com/DoPlan-dev/CLI/releases/download/v1.0.0/doplan_1.0.0_darwin_amd64.tar.gz"
15+
sha256 "REPLACE_WITH_ACTUAL_SHA256_AFTER_FIRST_RELEASE"
16+
end
17+
if Hardware::CPU.arm?
18+
url "https://github.com/DoPlan-dev/CLI/releases/download/v1.0.0/doplan_1.0.0_darwin_arm64.tar.gz"
19+
sha256 "REPLACE_WITH_ACTUAL_SHA256_AFTER_FIRST_RELEASE"
20+
end
21+
end
22+
23+
on_linux do
24+
if Hardware::CPU.intel?
25+
url "https://github.com/DoPlan-dev/CLI/releases/download/v1.0.0/doplan_1.0.0_linux_amd64.tar.gz"
26+
sha256 "REPLACE_WITH_ACTUAL_SHA256_AFTER_FIRST_RELEASE"
27+
end
28+
if Hardware::CPU.arm?
29+
url "https://github.com/DoPlan-dev/CLI/releases/download/v1.0.0/doplan_1.0.0_linux_arm64.tar.gz"
30+
sha256 "REPLACE_WITH_ACTUAL_SHA256_AFTER_FIRST_RELEASE"
31+
end
32+
end
33+
34+
def install
35+
bin.install "doplan"
36+
end
37+
38+
test do
39+
system "#{bin}/doplan --version"
40+
end
41+
end
42+

LICENSE

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
MIT License
2+
3+
Copyright (c) 2025 DoPlan
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.
22+

Makefile

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
.PHONY: build install test clean release help
2+
3+
# Variables
4+
BINARY_NAME=doplan
5+
VERSION?=dev
6+
COMMIT?=$(shell git rev-parse --short HEAD 2>/dev/null || echo "unknown")
7+
BUILD_TIME?=$(shell date -u '+%Y-%m-%d_%H:%M:%S')
8+
9+
# Build flags
10+
LDFLAGS=-ldflags "-X main.version=$(VERSION) -X main.commit=$(COMMIT) -X main.date=$(BUILD_TIME)"
11+
12+
help: ## Show this help message
13+
@echo 'Usage: make [target]'
14+
@echo ''
15+
@echo 'Available targets:'
16+
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {printf " %-15s %s\n", $$1, $$2}' $(MAKEFILE_LIST)
17+
18+
build: ## Build the binary
19+
@echo "Building $(BINARY_NAME)..."
20+
go build $(LDFLAGS) -o bin/$(BINARY_NAME) ./cmd/doplan
21+
22+
install: build ## Install the binary
23+
@echo "Installing $(BINARY_NAME)..."
24+
go install $(LDFLAGS) ./cmd/doplan
25+
26+
test: ## Run tests
27+
@echo "Running tests..."
28+
go test -v ./...
29+
30+
test-coverage: ## Run tests with coverage
31+
@echo "Running tests with coverage..."
32+
go test -v -coverprofile=coverage.out ./...
33+
go tool cover -html=coverage.out -o coverage.html
34+
35+
clean: ## Clean build artifacts
36+
@echo "Cleaning..."
37+
rm -rf bin/
38+
rm -f coverage.out coverage.html
39+
40+
release: ## Build release binaries
41+
@echo "Building release binaries..."
42+
goreleaser build --snapshot --clean
43+
44+
release-full: ## Full release with goreleaser
45+
@echo "Creating full release..."
46+
goreleaser release --clean
47+
48+
dev: ## Run in development mode
49+
@echo "Running in development mode..."
50+
go run $(LDFLAGS) ./cmd/doplan
51+
52+
fmt: ## Format code
53+
@echo "Formatting code..."
54+
go fmt ./...
55+
56+
vet: ## Run go vet
57+
@echo "Running go vet..."
58+
go vet ./...
59+
60+
lint: fmt vet ## Run linters
61+
62+
test-scripts: ## Run all test scripts
63+
@echo "Running CLI tests..."
64+
@./scripts/test-cli.sh || true
65+
@echo ""
66+
@echo "Running installation tests..."
67+
@./scripts/test-install.sh || true
68+
@echo ""
69+
@echo "Running integration tests..."
70+
@./scripts/test-integration.sh || true
71+
72+
release-prep: ## Prepare for release (tests, lint, build)
73+
@./scripts/pre-release.sh
74+
75+
release-create: ## Create a new release (usage: make release-create VERSION=v1.0.0)
76+
@if [ -z "$(VERSION)" ]; then \
77+
echo "Usage: make release-create VERSION=v1.0.0"; \
78+
exit 1; \
79+
fi
80+
@./scripts/release.sh $(VERSION)
81+
82+
release-snapshot: ## Create a snapshot release
83+
@goreleaser release --snapshot --clean
84+
85+
.DEFAULT_GOAL := help
86+

0 commit comments

Comments
 (0)