Skip to content

Commit c7e7137

Browse files
committed
Bootstrap project structure
0 parents  commit c7e7137

6 files changed

Lines changed: 98 additions & 0 deletions

File tree

.env.example

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# API Key (required)
2+
# Get yours at: https://console.anthropic.com/
3+
ANTHROPIC_API_KEY=sk-ant-xxx
4+
5+
# Model ID (required)
6+
MODEL_ID=claude-sonnet-4-6

.gitignore

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# macOS
2+
.DS_Store
3+
4+
# Xcode
5+
xcuserdata/
6+
*.xcodeproj/
7+
*.hmap
8+
*.ipa
9+
*.dSYM.zip
10+
*.dSYM
11+
timeline.xctimeline
12+
playground.xcworkspace
13+
DerivedData/
14+
15+
# Swift Package Manager
16+
.build/
17+
.swiftpm/
18+
Package.resolved
19+
20+
# CocoaPods
21+
# Pods/
22+
23+
# Carthage
24+
Carthage/Build/
25+
26+
# fastlane
27+
fastlane/report.xml
28+
fastlane/Preview.html
29+
fastlane/screenshots/**/*.png
30+
fastlane/test_output
31+
32+
# Environment
33+
.env
34+
35+
# Documentation
36+
docs/
37+
CLAUDE.md
38+
39+
# Test results
40+
tests/results/

Package.swift

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
// swift-tools-version: 6.2
2+
// The swift-tools-version declares the minimum version of Swift required to build this package.
3+
4+
import PackageDescription
5+
6+
let package = Package(
7+
name: "swift-claude-code",
8+
platforms: [.macOS(.v10_15)],
9+
products: [
10+
.executable(name: "claude", targets: ["cli"]),
11+
.library(name: "Core", targets: ["Core"])
12+
],
13+
dependencies: [
14+
.package(url: "https://github.com/swift-server/async-http-client.git", from: "1.32.0")
15+
],
16+
targets: [
17+
.executableTarget(
18+
name: "cli",
19+
dependencies: ["Core"],
20+
path: "Sources/cli"
21+
),
22+
.target(
23+
name: "Core",
24+
dependencies: [
25+
.product(name: "AsyncHTTPClient", package: "async-http-client")
26+
],
27+
path: "Sources/Core"
28+
),
29+
.testTarget(
30+
name: "CoreTests",
31+
dependencies: ["Core"],
32+
path: "Tests/CoreTests"
33+
),
34+
]
35+
)

Sources/Core/Agent.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
public enum Agent {
2+
public static let version = "0.1.0"
3+
}

Sources/cli/SwiftClaudeCode.swift

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import Core
2+
3+
@main
4+
struct SwiftClaudeCode {
5+
static func main() async throws {
6+
print("swift-claude-code v\(Agent.version)")
7+
}
8+
}

Tests/CoreTests/AgentTests.swift

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import Testing
2+
@testable import Core
3+
4+
@Test func versionExists() {
5+
#expect(Agent.version == "0.1.0")
6+
}

0 commit comments

Comments
 (0)