Contributing
Set up the repository, run the checks CI runs, and know where a change to the code or these docs belongs.
KLineChartQuant is open source under Apache-2.0. Fixes, indicators, connectors and documentation are all welcome. This page gets you from a fresh clone to a pull request that passes CI.
The repository
Work happens in TsekaLuk/KLineChartQuant, a fork of the original 363045841/KLineChartQuant. The license is Apache-2.0; keep the NOTICE file intact when you redistribute.
Set up
You need Node ^22.19.0 or >=24.11.0 and pnpm. CI runs pnpm 12 on Node 22 and 24.
Install
git clone https://github.com/TsekaLuk/KLineChartQuant.git
cd KLineChartQuant
pnpm installStart the dev server
pnpm devThis starts the Vite preview of the Vue package. The built-in mock source needs no backend, so you can render a chart before any connector is running.
Add real data (optional)
pnpm setup:backends # clone the connectors next to this repository
pnpm dev -c all # dev server + gotdx, binance and baostockSee Connectors for each source, its port and its requirements.
Before you open a pull request
Run the same checks CI runs:
pnpm lint # Biome
pnpm lint:ui # ESLint + stylelint on packages/vue/src
pnpm build:packages # core → agent-runtime → vue
pnpm type-check # source and tests
pnpm test:packages # vitest in every workspace
pnpm lint:types # are-the-types-wrong on publishable packagestype-check and lint:types resolve workspace packages through their built dist/*.d.ts, so build first. If you touched indicators, also run pnpm indicators:check.
Required gates (unit tests, type checks, type resolution, the UI lint ratchet, indicator discovery) fail the build. Bundle size budgets, publint and the recursive pnpm -r build currently only warn. The full matrix, and what blocks each warning from becoming required, is in CI gates.
lint:ui is a ratchet. Existing violations are recorded in suppression files and CI fails only when a file gains new ones. After paying down debt, run pnpm lint:ui:prune so the baseline shrinks.
The root README.md and README_CN.md are generated. Edit the fragments in docs/fragments, then run pnpm docs:generate; pnpm docs:check verifies they are in sync.
Common contributions
Add an indicator
Indicators are registered with the @Indicator decorator and discovered automatically, so there is no registry to edit by hand. The indicator authoring template lists the files to change, in dependency order, and the tests each one needs.
Add a data source
Implement the HTTP API in your service and register a provider for it, or write an in-process provider against the Provider API. New built-in sources also belong in dataSourceRegistry and in the README data-source fragment.
Record a decision
Decisions that shape the product live in docs/adr as NNNN-kebab-title.md, one per file and never renumbered. Status moves from Proposed to Accepted, then to Superseded by NNNN or Deprecated. Supersede an accepted ADR rather than editing its decision. For examples, see 0005: renderer freeze and 0006: settings apply instantly.
Releases
Maintainers release by pushing a version tag. GitHub Actions builds and publishes @363045841yyt/klinechart-core, @363045841yyt/klinechart-agent-runtime and @363045841yyt/klinechart to npm through trusted publishing, with no stored npm token. The steps are in the release guide.
How these docs are built
This site has two kinds of pages, and a fix goes to a different place for each.
- Hand-written pages, like this one, live in the Nebutra-Sailor repository under
apps/kcq-docs/content/docs/enand/zh. Edit them there. - Generated pages are built from the chart source at the commit pinned in
apps/kcq/chart-source.json. That covers the component and package reference, the Agent tool reference, the HTTP API and live-bars contracts, the changelog, and the imported architecture documents, design notes, ADRs and contributor guides. They are regenerated on every docs build and are not committed.
So a correction to a generated page is a correction to the chart source: the document under docs/, the JSDoc on a component prop, the tool description on a @Tool method. Open the pull request against KLineChartQuant. Once it merges and the pin moves to a commit that includes it, the page updates on the next build.