Swift SDK for the Kaiten project management API. OpenAPI-generated types with typed errors, automatic retry on 429 Too Many Requests, and Bearer token authentication.
Full Kaiten API documentation: developers.kaiten.ru
Add KaitenSDK to your Package.swift:
dependencies: [
.package(url: "https://github.com/AllDmeat/kaiten-sdk.git", from: "0.1.0"),
],
targets: [
.target(
name: "YourTarget",
dependencies: [
.product(name: "KaitenSDK", package: "KaitenSDK"),
]
),
]mise — a tool version manager. It will install the required version automatically:
mise use github:alldmeat/kaiten-sdkDownload the binary for your platform from the releases page.
swift build -c release
# Binary: .build/release/kaitenimport KaitenSDK
let client = try KaitenClient(
baseURL: "https://your-company.kaiten.ru/api/latest",
token: "your-api-token"
)
let spaces = try await client.listSpaces()
let cards = try await client.listCards(boardId: 42)
let card = try await client.getCard(id: 123)The CLI resolves credentials in order: flags → config file.
Get your API token at https://<your-company>.kaiten.ru/profile/api-key.
Option 1 — Config file (recommended):
Create ~/.config/kaiten/config.json:
{
"url": "https://<your-company>.kaiten.ru/api/latest",
"token": "<your-api-token>"
}Then run commands:
kaiten list-spaces
kaiten get-card --id 123| Method | Description |
|---|---|
listCards(boardId:) |
List all cards on a board |
getCard(id:) |
Fetch a single card by ID |
createCard(...) |
Create a new card |
updateCard(...) |
Update a card |
deleteCard(...) |
Delete a card |
listCardChildren(...) |
List child cards |
addCardChild(...) |
Add a child card |
removeCardChild(...) |
Remove a child card |
getCardMembers(cardId:) |
Get members of a card |
addCardMember(...) |
Add a member to a card |
updateCardMemberRole(...) |
Update a card member's role |
removeCardMember(...) |
Remove a member from a card |
getCardComments(cardId:) |
Get comments on a card |
createComment(cardId:text:) |
Add a comment to a card |
updateComment(...) |
Update a comment |
deleteComment(...) |
Delete a comment |
listCardTags(...) |
List tags on a card |
addCardTag(...) |
Add a tag to a card |
removeCardTag(...) |
Remove a tag from a card |
listCardBlockers(...) |
List card blockers |
createCardBlocker(...) |
Create a card blocker |
updateCardBlocker(...) |
Update a card blocker |
deleteCardBlocker(...) |
Delete a card blocker |
getCardLocationHistory(...) |
Get card location history |
getCardBaselines(...) |
Get card baselines |
| Method | Description |
|---|---|
createChecklist(...) |
Create a checklist on a card |
getChecklist(...) |
Get a checklist |
updateChecklist(...) |
Update a checklist |
removeChecklist(...) |
Remove a checklist |
createChecklistItem(...) |
Create a checklist item |
updateChecklistItem(...) |
Update a checklist item |
removeChecklistItem(...) |
Remove a checklist item |
| Method | Description |
|---|---|
listExternalLinks(...) |
List external links on a card |
createExternalLink(...) |
Create an external link |
updateExternalLink(...) |
Update an external link |
removeExternalLink(...) |
Remove an external link |
| Method | Description |
|---|---|
listSpaces() |
List all spaces |
createSpace(...) |
Create a space |
getSpace(...) |
Get a space by ID |
updateSpace(...) |
Update a space |
| Method | Description |
|---|---|
listBoards(spaceId:) |
List boards in a space |
getBoard(id:) |
Fetch a board by ID |
createBoard(...) |
Create a board |
updateBoard(...) |
Update a board |
| Method | Description |
|---|---|
getBoardColumns(boardId:) |
Get columns for a board |
createColumn(...) |
Create a column |
updateColumn(...) |
Update a column |
deleteColumn(...) |
Delete a column |
listSubcolumns(...) |
List subcolumns |
createSubcolumn(...) |
Create a subcolumn |
updateSubcolumn(...) |
Update a subcolumn |
deleteSubcolumn(...) |
Delete a subcolumn |
| Method | Description |
|---|---|
getBoardLanes(boardId:) |
Get lanes for a board |
createLane(...) |
Create a lane |
updateLane(...) |
Update a lane |
| Method | Description |
|---|---|
listCustomProperties() |
List all custom property definitions |
getCustomProperty(id:) |
Get a single custom property definition |
listCustomPropertySelectValues(propertyId:) |
List select values for a custom property |
getCustomPropertySelectValue(propertyId:id:) |
Get a single select value |
| Method | Description |
|---|---|
listUsers() |
List all users |
getCurrentUser() |
Get the current user |
| Method | Description |
|---|---|
listCardTypes() |
List card types |
listSprints() |
List sprints |
getSprintSummary(...) |
Get sprint summary |
The CLI and MCP server share the same config file at ~/.config/kaiten/config.json (see Configure Credentials above).
Use --config to provide a custom config file path when needed.
All methods throw KaitenError, which provides typed cases for every failure mode:
do {
let card = try await client.getCard(id: 999)
} catch let error as KaitenError {
switch error {
case .missingConfiguration(let key):
print("Missing config: \(key)")
case .invalidURL(let url):
print("Bad URL: \(url)")
case .unauthorized:
print("Check your API token")
case .notFound(let resource, let id):
print("\(resource) \(id) not found")
case .rateLimited(let retryAfter):
print("Rate limited, retry after: \(String(describing: retryAfter))")
case .serverError(let statusCode, let body):
print("Server error \(statusCode): \(body ?? "")")
case .networkError(let underlying):
print("Network: \(underlying)")
case .unexpectedResponse(let statusCode):
print("Unexpected HTTP \(statusCode)")
}
}- Swift 6.2+
- macOS 15+ (ARM) / Linux (x86-64, ARM)
See LICENSE for details.