1 | Koding CLI Task Manager
|
2 | =======================
|
3 |
|
4 | This is cli tool for managing Koding Kites.
|
5 |
|
6 | ## What is a Kite ?
|
7 |
|
8 | Kites are simple processes that inter-communicates with Koding and other Kites.
|
9 |
|
10 | For more details see: http://....
|
11 |
|
12 | ## Install
|
13 |
|
14 | npm install -g kd
|
15 |
|
16 | ## Register your host machine
|
17 |
|
18 | kd register
|
19 |
|
20 | you'll see
|
21 |
|
22 | $ kd register
|
23 | register:
|
24 | register: Hello ybrs!
|
25 | register:
|
26 | register: Please visit the following URL to connect your
|
27 | register: host to this computer.
|
28 | register:
|
29 | register:
|
30 | register: https://koding.com/-/KD/Register/aybarss-MacBook-Air. local/hnn91jkty8scm9momi51nc1sor7onri4hm5azhmncs5hhmy8nsu55ssssyssjsss
|
31 | register:
|
32 | register: Waiting for you to connect the host.
|
33 |
|
34 | simply visit the url in browser, then you'll see
|
35 |
|
36 | register: Host connected! Thanks for registering, now I'm sure you are ybrs!
|
37 |
|
38 | ## Create a kite and run it
|
39 |
|
40 | kd kite create-worker kitename
|
41 |
|
42 | now you can run the kite
|
43 |
|
44 | cd kitename.kite
|
45 | kd kite run
|
46 |
|
47 | Then you can call kite's functions using console:
|
48 |
|
49 | KD.singletons.kiteController.run({
|
50 | kiteName: "kitename",
|
51 | method: "helloWorld",
|
52 | withArgs: {name: 'hi'}
|
53 | }, function() {
|
54 | console.log(arguments)
|
55 | });
|
56 |
|
57 | ## Create a server
|
58 |
|
59 | kd kite create-server serverkite
|
60 |
|
61 | you'll see output like:
|
62 |
|
63 | $ kd kite run
|
64 | kite: Kite has been compiled!
|
65 | kite: Attempting to run serverkite
|
66 | kite: Finding a free port...
|
67 | kite: Server is running on http://127.0.0.1:54282
|
68 | kite: Port found: 54282
|
69 | kite: Publishing server...
|
70 | server: downloading dependencies...
|
71 | server: dependencies downloaded.
|
72 | server: dependencies installing...
|
73 | server: Listening 127.0.0.1:54282 and sharing with the name 'serverkite-1'. Please wait...
|
74 | server: 127.0.0.1:54282 has something on it!
|
75 | server: Started instance on 27334
|
76 | kite: serverkite: Intra-Kite communication is ready
|
77 | kite: serverkite: Kite is connected to system
|
78 | server: .
|
79 | server: your public url: {"host":"serverkite-1-ybrs.kd.io"}
|
80 |
|
81 |
|
82 | this registers your kite, to Koding and Koding proxies your kite to the world, so you can access the url from anywhere
|
83 |
|
84 | http://serverkite-1-ybrs.kd.io
|
85 |
|
86 | ### Add unit tests to your Kite
|
87 |
|
88 | When you create a kite, you will have a `test` directory in it. KD tool uses Mocha test library, to run the tests
|
89 |
|
90 | kd kite test
|
91 |
|
92 | ### Configuring the Kite
|
93 |
|
94 | Kites have `manifest.json` files. They hold your kites' meta data, such as author information, name etc. |
\ | No newline at end of file |